-
Notifications
You must be signed in to change notification settings - Fork 840
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
Use minheap as timeout container and fix collision of multiple SelectConnection timeouts with same deadline and callback #947
Use minheap as timeout container and fix collision of multiple SelectConnection timeouts with same deadline and callback #947
Conversation
…thSameDeadlineAndCallback
…sWithSameDeadlineAndCallback
970c2d3
to
5bd1a04
Compare
5495577
to
676e7e9
Compare
8b7f4ff
to
84b1061
Compare
84b1061
to
90a32c8
Compare
… signature. Remove errant param documentation from Poller constructors.
cc @lukebakken Ready for review |
…OLoop to the poller in order to prevent cyclical references that interfere with garbage collection.
I tried to use weakref and it resulted in test failures. I will be working through it shortly |
…ods, since instance methods have temporary references
@lukebakken - this is ready for review. Thanks! |
@lukebakken, do you anticipate an opportunity to review this in the near future? My next PR #956 that implements the thread-safe callback request feature in BlockingConnection and SelectConnection builds on this PR. Thx! |
@vitaly-krugl I'll get it today. I didn't notice that "DO NOT MERGE" had been removed from the title. |
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.
This looks great and tests pass locally and on Travis
Thank you for reviewing, @lukebakken! |
…adline Use minheap as timeout container and fix collision of multiple SelectConnection timeouts with same deadline and callback (cherry picked from commit 0e13941)
(Note that the failed coverage test results from pika's encrypted credentials configuration issue.)
hash(frozenset(value.items()))
used by the legacy implementation ofSelectConnection
's_PollerBase.add_timeout
readily results in timer id collision if multiple timers have very close deadlines and same callback. See failedTestViabilityOfMultipleTimeoutsWithSameDeadlineAndCallback
test results in https://ci.appveyor.com/project/gmr/pika/build/1.0.409. This is aided by Windowstime.time()
having lower resolution than on Linux. However, on a faster machine, the same problem would also likely show up on linux, and hashes aren't guaranteed to be unique for all input set. And I recall getting it on my dev MacBookPro a long time ago.