Skip to content

Change default child watcher to PidfdChildWatcher on supported Linux versions #98023

Description

@kumaraditya303

PidfdChildWatcher based on pidfd_open is the best child watcher implementation for Linux as it avoids race conditions and is most reliable of all of them. It requires Linux 5.3+ so this will be detected at runtime if it can be used and if so use this instead of ThreadedChildWatcher. asyncio will favor using PidfdChildWatcher over ThreadedChildWatcher in 3.12+ on systems which supports it.

Activity

  1. added a commit that references this issue on Oct 8, 2022
  2. gvanrossum commented on Oct 8, 2022

    @gvanrossum
    Member

    Thanks!

    There's a little bit of possible cleanup -- the check whether os.pidfd_open() exists and works (can_use_pidfd()) is duplicated in Lib/test/test_asyncio/test_subprocess.py (as _has_pidfd_support). While can_use_pidfd() is not a documented or public API I think it's better to call it from the test code so there's only one copy to update if the check ever changes.

  3. Repository owner moved this from Todo to Done in asyncioon Oct 8, 2022
  4. added a commit that references this issue on Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions