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

IAsyncResult wait() has a race. #485

Closed
jgh-ds opened this issue Nov 4, 2017 · 0 comments · Fixed by #487
Closed

IAsyncResult wait() has a race. #485

jgh-ds opened this issue Nov 4, 2017 · 0 comments · Fixed by #487

Comments

@jgh-ds
Copy link
Contributor

jgh-ds commented Nov 4, 2017

The wait() method of the IAsyncResult has a race. If it is called after the asynchronous operation has completed, the Condition wait() will be stuck forever.

The attached bug.py.txt file demonstrates the problem. The key to triggering it is to call time.sleep(1) before calling wait().
bug.py.txt

Basically, the handlers.utils.AsyncResults.wait() method needs to only call the condition.wait() if the result is not ready(). I've attached a git diff output to illustrate the fix.

diff.txt

Thanks,

Jim Hanko

jgh-ds added a commit to jgh-ds/kazoo that referenced this issue Nov 6, 2017
Signed-off-by: Jim Hanko <hanko@drivescale.com>
jgh-ds added a commit to jgh-ds/kazoo that referenced this issue Nov 6, 2017
jgh-ds added a commit to jgh-ds/kazoo that referenced this issue Nov 6, 2017
jeffwidman pushed a commit that referenced this issue Nov 10, 2017
fix(core): resolve race in IAsyncResult.wait()

closes #485
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant