Message306745
If some parent process has disabled SIGCHLD, that signal is inherited and stops that signal being delivered, which means that asyncio.Process.wait will never complete.
As an example, the plan9port terminal window, 9term, (https://9fans.github.io/plan9port/man/man1/9term.html) does this, and hence causes async Python processes to hang forever.
Python should probably code defensively against this and ensure that SIGCHLD is enabled regardless. Attached is some C code that demonstrates the issue when the following python code is saved to "tst.py".
#!/usr/bin/env python3
import asyncio
async def do_exec():
cmd = ['echo', 'hello, world']
process = await asyncio.create_subprocess_exec(*cmd, env={})
await process.wait()
loop=asyncio.get_event_loop()
try:
loop.run_until_complete(do_exec())
finally:
loop.close()
demonstration of the issue. |
|
Date |
User |
Action |
Args |
2017-11-22 18:32:13 | rogpeppe | set | recipients:
+ rogpeppe, yselivanov |
2017-11-22 18:32:12 | rogpeppe | set | messageid: <1511375532.97.0.213398074469.issue32115@psf.upfronthosting.co.za> |
2017-11-22 18:32:12 | rogpeppe | link | issue32115 messages |
2017-11-22 18:32:12 | rogpeppe | create | |
|