Title: asyncio: Prohibit adding a signal handler for SIGCHLD
Type: Stage:
Components: asyncio Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, gregory.p.smith, pitrou, yselivanov
Priority: normal Keywords:

Created on 2018-05-25 20:56 by yselivanov, last changed 2018-06-01 19:41 by pitrou.

Messages (3)
msg317717 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-05-25 20:56
Doing that will break subprocesses.
msg318454 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-06-01 19:00
To clarify this ticket: I'm talking about prohibiting `loop.add_signal_handler(SIGCHLD)` as it would break child processes watchers that asyncio installs. In other words, setting a custom SIGCHLD breaks asyncio internals.

We can allow user-set SIGCHLD signals if we add some code to make sure that 'add_signal_handler(SIGCHLD)' delivers the signal to *both* asyncio internals and user code.  But I'm not sure if there's a valid use case for listening for SIGCHLD for user code at all.

For now, I disabled SIGCHLD in uvloop, let's see if people complain.
msg318455 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2018-06-01 19:41
Some people may have reasons to do that (for example: they write their own subprocess implementation). I suggest emitting a warning rather than forbidding it.
Date User Action Args
2018-06-01 19:41:05pitrousetnosy: + pitrou
messages: + msg318455
2018-06-01 19:39:53pitrousettitle: Prohibit adding a signal handler for SIGCHLD -> asyncio: Prohibit adding a signal handler for SIGCHLD
2018-06-01 19:00:39yselivanovsetmessages: + msg318454
2018-06-01 18:51:18ned.deilysetnosy: + gregory.p.smith
2018-05-25 20:56:35yselivanovcreate