-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fix uv__io_stop assertion failures #101
Fix uv__io_stop assertion failures #101
Conversation
…file handle watches
@@ -230,15 +230,17 @@ class ZooKeeper: public ObjectWrap { | |||
last_activity = uv_now(uv_default_loop()); | |||
|
|||
int rc = zookeeper_interest(zhandle, &fd, &interest, &tv); | |||
|
|||
if (uv_is_active((uv_handle_t*) &zk_io)) { | |||
uv_poll_stop(&zk_io); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can safely call uv_poll_stop directly, it wont do anything if the handle is not active.
@yfinkelstein any chance this could get merged in? I've been running with my forked version since I posted this and I haven't yet seen any trouble. I'd love to get back to using a copy from npmjs.org. |
@yfinkelstein +1 on this |
@yfinkelstein any chance that this could be merged in? I've been maintaining a fork of node-zookeeper with my pending pull requests and I'd love to get back into sync with the project. |
@kuebk it looks like you might have access to mering into this repo. Is there any chance I can get your help merging a couple of fixes into this project? |
@mdlavin You can always send a pull request in. I'm not actively working on the project, if the pull request is auto-resolvable I can review and accept. Thanks! |
@mdlavin Just accepted 2 of your pull requests |
Thanks for merging the other fixes. If there is a problem with this I am part of a group that is actively using this project, is there any
|
Matt, |
Fix uv__io_stop assertion failures
When running an application that uses many different ZooKeeper connections, and experiences many 'operation timeout' errors, I would frequently see this failure:
After some debugging here is what I saw:
if (rc)
block, which does not stop watching the file handleThe changes I've attached will always call uv_poll_stop, even in the case of an error, so that the file handle will be stop being watched. After my changes, I can run my many-client, many-timeout test without any assertion failures.