-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
c23643b
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.
I wonder why does this make a difference... Shouldn't Event.wait() return immediately if it's set?
c23643b
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.
It's because the
asyncio.wait_for()
creates a separate task and wraps it aroundself._enqueue_event.wait()
. This means it doesn't get a chance to return until it's already being run in another task, even if the event was set to begin with.c23643b
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.
Do you mean if there's another CPU-bound task it can prevent .wait() from running? Like explained there?https://stackoverflow.com/questions/74132015/asyncio-wait-for-doesnt-time-out-as-expected
But shouldn't it just take longer than hang up?
c23643b
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.
Sorry, I read your comment to this. Great job that you found the fix for this nasty issue! 👍