GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Popen should use pidfd_open to implement a non-busy wait · Issue #83069 · python/cpython

Popen should use pidfd_open to implement a non-busy wait #83069

New issue
Copy link
New issue
Copy link
Closed
Closed
Popen should use pidfd_open to implement a non-busy wait#83069
Copy link
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

SpecLad
mannequin
opened on Nov 21, 2019
Issue body actions
BPO 38888
Nosy @gpshead, @vstinner, @benjaminp, @SpecLad

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2019-11-21.21:43:43.189>
labels = ['type-feature', 'library', '3.9']
title = 'Popen should use pidfd_open to implement a non-busy wait'
updated_at = <Date 2019-11-21.22:20:50.812>
user = 'https://github.com/SpecLad'

bugs.python.org fields:

activity = <Date 2019-11-21.22:20:50.812>
actor = 'SpecLad'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-11-21.21:43:43.189>
creator = 'SpecLad'
dependencies = []
files = []
hgrepos = []
issue_num = 38888
keywords = []
message_count = 3.0
messages = ['357222', '357223', '357225']
nosy_count = 4.0
nosy_names = ['gregory.p.smith', 'vstinner', 'benjamin.peterson', 'SpecLad']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue38888'
versions = ['Python 3.9']

Linked PRs

  • gh-83069: Use efficient event-driven subprocess.Popen.wait() on Linux / macOS / BSD #144047

Activity

  1. SpecLad commented on Nov 21, 2019

    @SpecLad
    SpecLadmannequin
    on Nov 21, 2019
    MannequinAuthor
    More actions

    Popen.wait(timeout) is currently implemented on Unix-like systems using a busy wait, since the waitpid system call doesn't have a timeout argument.

    On Linux, it's now possible to do better than that. You can create a PID file descriptor using pidfd_create and poll that descriptor with the specified timeout. Popen.wait should make use of that.

  2. SpecLad
    added
    3.9 (EOL)end of lifeend of life
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancementA feature request or enhancement
    on Nov 21, 2019
  3. vstinner commented on Nov 21, 2019

    @vstinner
    vstinner
    on Nov 21, 2019
    Member
    More actions

    os.pidfd_open() was added to Python 3.9. Do you mean pidfd_open()?

  4. SpecLad commented on Nov 21, 2019

    @SpecLad
    SpecLadmannequin
    on Nov 21, 2019
    MannequinAuthor
    More actions

    Right, of course. I keep confusing it with timerfd_create.

  5. SpecLad
    changed the title [-]Popen should use pidfd_create to implement a non-busy wait[/-] [+]Popen should use pidfd_open to implement a non-busy wait[/+] on Nov 21, 2019
  6. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  7. giampaolo commented on Jan 19, 2026

    @giampaolo
    giampaolo
    on Jan 19, 2026
    Contributor
    More actions

    Hi. Since I recently implemented this in psutil (giampaolo/psutil#2706), I decided to give this a try and port this change to the subprocess module. I created a PR which uses pidfd_open() on Linux and also adds support for macOS and BSD by using kqueue(): #144047.

    Reacted by Victor Stinner
  8. vstinner
    added a commit that references this issue on Jan 28, 2026

    gh-83069: Use efficient event-driven `subprocess.Popen.wait()` on Lin…

    9b154ab
  9. vstinner
    closed this as completedon Jan 28, 2026
  10. vstinner commented on Jan 28, 2026

    @vstinner
    vstinner
    on Jan 28, 2026
    Member
    More actions

    The feature is now implemented, I close the issue.

  11. thunder-coding
    added a commit that references this issue on Feb 15, 2026

    pythongh-83069: Use efficient event-driven `subprocess.Popen.wait()` …

    368281f
  12. gpshead
    added 2 commits that reference this issue on Jul 29, 2026

    gh-154836: Fix Popen.wait() with very large timeouts on the pidfd/kqu…

    11d0da5

    [3.15] gh-154836: Fix Popen.wait() with very large timeouts on the pi…

    dd2714d
  13. mbeijen
    added a commit that references this issue on Aug 14, 2026

    pythongh-154836: Fix Popen.wait() with very large timeouts on the pid…

    8377ae7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.