Fix thread reentry deadlocks#2832
Merged
oremanj merged 2 commits intopython-trio:masterfrom Oct 24, 2023
Merged
Conversation
if there is a checkpoint after the result is put on the queue to the thread, there is a thread race with a chance to reschedule the task twice, causing hangs. The try-finally suite was removed as it makes typing difficult and none of the operations can fail (barring MemoryErrors and friends.)
60687e4 to
66069ac
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2832 +/- ##
=======================================
Coverage 99.16% 99.16%
=======================================
Files 115 115
Lines 17475 17483 +8
Branches 3111 3115 +4
=======================================
+ Hits 17329 17337 +8
Misses 101 101
Partials 45 45
|
Contributor
Author
|
The test wasn't quite 100% reliably triggered in CI but much more frequently than the intermittent failures we had been seeing. |
Member
|
Thanks for fixing this! |
Member
|
Awesome, thanks for the quick fix! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should fix the timeouts @jakkdl worked on in #2827, which were introduced in #2392. Some discussion from chat:
I'm going to first see how the test suite goes on my new regression test, then push the fix.