Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The handling of children for non-existent nodes in ZooCache may not be correct. #5047

Open
keith-turner opened this issue Nov 8, 2024 · 0 comments
Labels
bug This issue has been verified to be a bug.

Comments

@keith-turner
Copy link
Contributor

keith-turner commented Nov 8, 2024

Describe the bug

ZooCache attempts to cache nonexistence. This may not be done correctly for the case of getChildren.

The ZooCache code expects that ZooKeeper.getChildren() may return null here. However it will probably never return null. When a node in zookeeper exists and has no children an empty list is returned. When a node does not exist a NONODE KeeperException is thrown. The code zoocache code is handling this, however it does not cache this. The code behaves correctly, this is only a possible performance bug.

Expected behavior

  • Remove handling for null in code as its not expected to ever happen.
  • Determine if its safe to cache non-existence for getChildren, which depends on ZK watcher behavior. If it is safe then look into changing the code to cache this. If not then only the null handling needs to be removed for this issue.
@keith-turner keith-turner added the bug This issue has been verified to be a bug. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue has been verified to be a bug.
Projects
None yet
Development

No branches or pull requests

1 participant