Author aeros
Recipients aeros, asvetlov, benjamin.peterson, nanjekyejoannah, njs, vstinner, yselivanov
Date 2019-11-05.22:07:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572991642.53.0.478032431664.issue38692@roundup.psfhosted.org>
In-reply-to
Content
> My the main question is: how to detect if the new watcher can be used or asyncio should fallback to threaded based solution?

Perhaps in the __init__ we could do something like this:

class PidfdChildWatcher(AbstractChildWatcher):

    def __init__(self):
        if not hasattr(os, "pidfd_open"):
             raise RuntimeError("os.pidfd_open() is unavailable.")
        ...

Thoughts?

> My WIP progress patch is attached. It passes all asyncio tests.

I think we could also specifically look for race conditions with `./python -m test test_asyncio.test_subprocess -F -j4`, rather than relying on the tests passing with a single job. The other child watchers have been particularly infamous when it comes race conditions and resource leaks. 

I'd be glad to work on testing and opening a PR to asyncio if needed (while giving Benjamin credit for the patch of course).
History
Date User Action Args
2019-11-05 22:07:22aerossetrecipients: + aeros, vstinner, benjamin.peterson, njs, asvetlov, yselivanov, nanjekyejoannah
2019-11-05 22:07:22aerossetmessageid: <1572991642.53.0.478032431664.issue38692@roundup.psfhosted.org>
2019-11-05 22:07:22aeroslinkissue38692 messages
2019-11-05 22:07:22aeroscreate