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, njs, vstinner, yselivanov
Date 2020-05-12.11:37:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think I have a possible explanation for this now.

In my reproducer script and in the original test, the wakeup file descriptor isn't set. I think this explains why the loop isn't waking up to call SIGCHLD's handler when the signal comes in. The reason the wakeup file descriptor isn't set in the original test is that MultiLoopChildWatcher registers the SIGCHLD handler using signal.signal():
rather than using loop.add_signal_handler(), which calls signal.set_wakeup_fd():

Is there a reason MultiLoopChildWatcher.attach_loop() isn't calling loop.add_signal_handler()? Since attach_loop() has to be called from the main thread anyways, it seems like it could be okay.

I also wonder if the documentation could perhaps be more specific as to the difference between loop.add_signal_handler() and signal.signal(). Currently, it just says callbacks registered with add_signal_handler() are "allowed to interact with the event loop":
But it doesn't give any warnings about using signal.signal(). For example, it might be worth saying something about the possibility of hangs if add_signal_handler() isn't used.
Date User Action Args
2020-05-12 11:37:16chris.jerdoneksetrecipients: + chris.jerdonek, vstinner, njs, asvetlov, yselivanov, aeros
2020-05-12 11:37:16chris.jerdoneksetmessageid: <>
2020-05-12 11:37:16chris.jerdoneklinkissue38323 messages
2020-05-12 11:37:16chris.jerdonekcreate