You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate work for finished CurrentThreadExecutor to previous executor (#494)
* Redirect work for finished CurrentThreadExecutor to previous executor
A CurrentThreadExecutor may terminate with work still remaining in its
queue, or new work may be submitted later. We previously discarded
remaining work, leading to deadlocks, and raised an error on
submitting late work. Instead, execute remaining work immediately,
and if there’s another CurrentThreadExecutor for the same thread below
us on the stack, redirect late work there to allow it to eventually
run.
Doing this in a thread-safe way requires replacing the queue.Queue
abstraction with collections.deque and
threading.ConditionVariable (the same primitives used to implement
queue.Queue).
Fixes#491; fixes#492.
Signed-off-by: Anders Kaseorg <[email protected]>
* Add regression tests for #491 and #492
Signed-off-by: Anders Kaseorg <[email protected]>
* Skip asyncio.Barrier test for Python <3.11.
* Make test definition Python version dependent.
Avoids mypy error on asyncio.Barrier API.
---------
Signed-off-by: Anders Kaseorg <[email protected]>
Co-authored-by: Carlton Gibson <[email protected]>
0 commit comments