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 rogpeppe
Recipients rogpeppe, yselivanov
Date 2017-11-22.18:32:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511375532.97.0.213398074469.issue32115@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-11-22 18:32:13rogpeppesetrecipients: + rogpeppe, yselivanov
2017-11-22 18:32:12rogpeppesetmessageid: <1511375532.97.0.213398074469.issue32115@psf.upfronthosting.co.za>
2017-11-22 18:32:12rogpeppelinkissue32115 messages
2017-11-22 18:32:12rogpeppecreate