This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients aeros, asvetlov, chris.jerdonek, vstinner, yselivanov
Date 2020-05-09.04:44:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I looked into this a little after reproducing it locally.

What I found is that MultiLoopChildWatcher._sig_chld() *is* called. It's just that it's only called immediately after timeout=5 has elapsed. (The timeout=5 was added by Andrew here: )

Consider this line in asyncio.tasks.wait_for(), which is to trigger the timeout:

  timeout_handle = loop.call_later(timeout, _release_waiter, waiter)

I put some debug statements inside _release_waiter, and I found that _sig_chld() is called after the timeout has elapsed and before _release_waiter starts. So basically, it looks like CPython is holding onto the signal, and waiting for the loop to do something more before running the handler and calling the _sig_chld().

The code base already has logic to skip running signal handlers in various cases, but I don't know whether it relates to this issue:

It seems like there are a number of issues on the tracker related to signals (some solved and others not, e.g. ). So it looks to me like this could point to a deeper issue between asyncio and CPython's signal handling.
Date User Action Args
2020-05-09 04:44:43chris.jerdoneksetrecipients: + chris.jerdonek, vstinner, asvetlov, yselivanov, aeros
2020-05-09 04:44:43chris.jerdoneksetmessageid: <>
2020-05-09 04:44:43chris.jerdoneklinkissue38323 messages
2020-05-09 04:44:43chris.jerdonekcreate