diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-09-22 16:43:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 16:43:47 (GMT) |
commit | 282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6 (patch) | |
tree | a6efefab8efedf314d63a08882179ee54c418ff7 /Lib | |
parent | 24e03796248ab8c7f62d715c28156abe2f1c0d20 (diff) | |
download | cpython-282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6.zip cpython-282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6.tar.gz cpython-282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6.tar.bz2 |
GH-85760: Fix race in calling process_exited callback too early (#97009)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncio/unix_events.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index cf7683f..96e6d73 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -223,7 +223,8 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): return transp def _child_watcher_callback(self, pid, returncode, transp): - self.call_soon_threadsafe(transp._process_exited, returncode) + # Skip one iteration for callbacks to be executed + self.call_soon_threadsafe(self.call_soon, transp._process_exited, returncode) async def create_unix_connection( self, protocol_factory, path=None, *, |