-
Notifications
You must be signed in to change notification settings - Fork 387
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
ChildrenWatch should not log exceptions if the node its watching is deleted #149
Comments
What is the desired behavior? I can update it so that it doesn't throw an exception and instead stops gracefully if the node is destroyed. |
In my opinion the desired behaviour would be to allow the client code to handle the error case itself instead of the library code logging the exception. It feels weird for my application to display tracebacks which I cannot intercept/hide. |
Wouldn't client code do that by placing a watch on the node as you suggest to determine if its deleted? In which case the desired behavior would be for this exception to be masked, right? |
Indeed, I can detect when the node gets deleted using a |
+1 here ... this is bugging me as well. Theres nothing we can do in our code to mask the error, so to our developers it looks like theres a real problem when there may not be. |
Adding in a unit test that proves the issue happens, but at the same time we cannot fix it. Instead, this test just guarantees that our own code doesn't fail. Bug report: python-zk/kazoo#149
I've updated the name to indicate what I believe the remedy should be. Since everything is functioning properly, logging exceptions isn't very useful. I might get to this later next week, otherwise a PR providing an option to mask it would be welcome. |
+1...Would this issue be solved sometime? The exception logging really annoy me. |
+1 Wouldn't there be any workaround until this is resolved? |
This implementation resolves the "NoNodeError" while watching children. Fix python-zk#149.
@vblazhnov I modified the implementation to close watching if watched node gone. |
This implementation resolves the "NoNodeError" while watching children. Fix python-zk#149.
Given the following code:
How can I gracefully handle the removal of
/test
from ZooKeeper ? The code raises the following exception, apparently in a watcher thread and I can't act based on that.I used a
DataWatch
to work around this issue and re-set theChildrenWatch
when/test
reappears, but the presence of the exception makes me think there's a bug/unhandled exception case in the kazoo code.The text was updated successfully, but these errors were encountered: