Fixes hangs when Python future notifier is enabled#590
Merged
jameslamb merged 3 commits intorapidsai:mainfrom Feb 13, 2026
Merged
Fixes hangs when Python future notifier is enabled#590jameslamb merged 3 commits intorapidsai:mainfrom
jameslamb merged 3 commits intorapidsai:mainfrom
Conversation
wence-
approved these changes
Feb 13, 2026
jameslamb
approved these changes
Feb 13, 2026
Member
jameslamb
left a comment
There was a problem hiding this comment.
Great investigation and very clear description, thanks!
Member
|
I'll admin-merge this for you since only |
Member
Author
|
Thanks @wence- for review, and @jameslamb for review and also admin-merging, appreciate it! |
17 tasks
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.
The
test_many_servers_many_clientshas been occasionally hanging for a long time when Python future notifier is enabled. Since Python 3.13.12, it started hanging almost 100% of the runs. Upon some investigation, it seems the hang comes from the notifier thread innotifier_thread.py:_run_request_notifier(worker)on the event loop viarun_coroutine_threadsafe. That coroutine callsworker.run_request_notifier(), which sets the asyncio futures thatep.send()/ep.recv()are awaiting.task.result(0.01)and, on timeout, callstask.cancel(). So whenever the coroutine doesn’t finish within 10 ms, it is cancelled.run_request_notifier()never runs, the asyncio futures for completed UCX requests are never set, and the test hangs insend/recvor inwait_listener_client_handlers.This resolves the persistent hang in Python 3.13.12, and may as well resolve the hangs that occurred occasionally in those tests as well.
Closes #586