Skip to content

refactor(supervisor): make managed child ownership structural #3154

Description

@elezar

Description

Make Linux managed-child ownership structural so callers cannot accidentally separate spawning, PID registration, waiting, unregistering, and lost-child diagnostics.

Context

The child reaper race fixed by PR #3142 required every Linux child path to use the correct registration protocol. The current registry helper closes the immediate spawn-to-registration window, but ownership remains a convention across canonical and SSH process paths. The diagnostics and wait-handling follow-ups explored during that review belong with the ownership cleanup.

Definition of Done

  • Introduce a managed-child abstraction that owns Linux child registration and cleanup.
  • Route canonical and SSH child paths through the abstraction.
  • Centralize explicit-wait handling, unregistering, and ECHILD diagnostics.
  • Add deterministic tests for ownership and reaper interleavings.
  • Preserve non-Linux behavior without introducing Linux-only reaper machinery there.

Related Work

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