Skip to content

Reap the supervised child after an interrupted subprocess call #1648

Done

Description

@eowca

test_status_reaps_gh_after_signal[2-130] intermittently sees the offline gh child PID after the supervisor exits 130. The same DID NOT RAISE ProcessLookupError failure occurred on main, the #1568 Mergify candidate, and #1496 attempt 1. The unchanged #1568 head passed its next candidate. The red and green candidates used the same Ubuntu 24.04 image version and CPython 3.14.6.

At 9bd151435, 60 ordinary local repetitions of the SIGINT case passed. A local probe synchronized SIGINT inside Popen.communicate and inspected the child after context exit in the transition under test. In five out of five runs the child still existed, returncode was unset, and an explicit wait() reaped it as -9. The interrupt remained KeyboardInterrupt.

CPython consumes its brief SIGINT wait inside communicate before _proc.run kills the child’s separate session. On entering Popen.__exit__ with KeyboardInterrupt, it skips a second wait, allowing the supervisor to exit before the child is reaped. The test exposes a product cleanup gap rather than a need for a retry.

Acceptance: after killing an interrupted child, _proc.run reaps it before propagating the interrupt. Keep the CLI SIGINT and SIGTERM cleanup assertions. Add deterministic coverage of the consumed-wait path and rerun the hosted checks.

Refs #575.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions