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
{{ message }}
Repository navigation
asyncio.subprocess blocked event loop unexpectedly on MacOS #158287
@starstreammm Do you mean that on Python 3.14.6 it works well? or is it on 3.13 that it works well? (this is to confirm whether it's a release blocker or not)
@starstreammm Do you mean that on Python 3.14.6 it works well? or is it on 3.13 that it works well? (this is to confirm whether it's a release blocker or not)
I updated my Python version yesterday. It had been quite a while since my last update, but I can confirm that I was already using 3.14 after the update. This issue didn't happen on that version. But I don't remember which version I used before exactly.
hey, i just took a quick look with my own tooling (on macos too)
The trace:
[EventLoopBlock] 'main' blocked the loop for 0.735s (threshold: 0.1s)
Stack at the moment of blocking:
File "/Users/timofeiivankov/cpython/repro.py", line 199, in <module>
asyncio.run(main())
File "/Users/timofeiivankov/cpython/Lib/asyncio/runners.py", line 205, in run
return runner.run(main)
File "/Users/timofeiivankov/cpython/Lib/asyncio/runners.py", line 128, in run
return self._loop.run_until_complete(task)
File "/Users/timofeiivankov/cpython/Lib/asyncio/base_events.py", line 712, in run_until_complete
self.run_forever()
File "/Users/timofeiivankov/cpython/Lib/asyncio/base_events.py", line 683, in run_forever
self._run_once()
File "/Users/timofeiivankov/cpython/Lib/asyncio/base_events.py", line 2090, in _run_once
handle._run()
File "/Users/timofeiivankov/cpython/Lib/asyncio/events.py", line 135, in _run
return super()._run()
File "/Users/timofeiivankov/cpython/Lib/asyncio/events.py", line 91, in _run
self._context.run(self._callback, *self._args)
File "/Users/timofeiivankov/cpython/Lib/asyncio/unix_events.py", line 1003, in _reap_and_notify
pid, returncode = self._reap(loop, expected_pid)
File "/Users/timofeiivankov/cpython/Lib/asyncio/unix_events.py", line 1008, in _reap
pid, status = os.waitpid(expected_pid, 0)
-> Culprit: _reap() at /Users/timofeiivankov/cpython/Lib/asyncio/unix_events.py:1008
So _reap is probably the cause, or the code near it. If no one objects, I can work on the PR
Activity
picnixz commentedon Sep 27, 2026
cc @kumaraditya303
picnixz commentedon Sep 27, 2026
@starstreammm Do you mean that on Python 3.14.6 it works well? or is it on 3.13 that it works well? (this is to confirm whether it's a release blocker or not)
starstreammm commentedon Sep 27, 2026
I updated my Python version yesterday. It had been quite a while since my last update, but I can confirm that I was already using 3.14 after the update. This issue didn't happen on that version. But I don't remember which version I used before exactly.
picnixz commentedon Sep 27, 2026
I'm going to let Kumar have a look at this issue and decide whether this is a release-blocker. At least, it's a regression AFAICT.
deadlovelll commentedon Sep 27, 2026
hey, i just took a quick look with my own tooling (on macos too)
The trace:
So
_reapis probably the cause, or the code near it. If no one objects, I can work on the PRpicnixz commentedon Sep 27, 2026
Can you bisect the faulty commit first? @deadlovelll
deadlovelll commentedon Sep 27, 2026
Faulty commit - 2875d1d (#153810). Fix is needed for main, 3.15 and 3.14
kumaraditya303 commentedon Oct 5, 2026
This seems like a macos kernel bug to me, dotnet is also hitting this quirk in dotnet/runtime#133930
I think the fix is to exclude
CLD_STOPPEDmanually here to avoid blocking inwaitpid.pythongh-158287: Add timeout to test_stopped_child_does_not_block_eve…
pythongh-158287: Clarify user-visible behavior in NEWS entry
pythongh-158287: Simplify CLD_STOPPED handling in _ThreadedChildWatcher
pythongh-158287: Use watchdog timer in test_stopped_child_does_not_bl…