Skip to content

Windows detached lifecycle needs stable process identity before bare PID teardown #969

Description

@davidfarah2003

Problem

PR #880 detaches Windows stack processes with native CreateProcess, closes the returned process handle, and retains only the PID. Later down and cleanup paths signal that bare PID.

Windows reuses PIDs. Once the original process exits, a later signal can target an unrelated process that inherited the same PID. The current pure smoke injects signal functions and does not exercise native process creation, handle lifetime, PID reuse, or the default process.kill boundary, so it cannot prove target identity.

Required design

Before detached-by-default stack lifecycle can land on Windows, Cotal needs one stable identity scheme across launch, pidfile state, status, and teardown. Acceptable shapes include:

  • retaining a process capability in a supervisor that outlives the invoking CLI; or
  • recording a creation identity and using an atomic open, verify, terminate operation that refuses PID reuse.

The design must define loud behavior for legacy PID-only records and for a target whose identity cannot be established.

Acceptance

  • A stale PID record whose PID now belongs to another process is refused and never signalled.
  • The native CreateProcess path, detached parent exit, identity persistence, reopen, and termination are exercised on Windows.
  • Manager, delivery, auth, and broker teardown use the same identity rule.
  • Cleanup failures preserve the record and name the reason.
  • Mutation proof removes or weakens the identity check and reddens named cells.

Context

This is the blocking prerequisite found while integrating PR #880 against current main. No current-main successor was created because preserving a known bare-PID teardown path would be unsafe.

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

    area:releasePrimary affected area: release.bugSomething isn't workingseverity:criticalConfirmed critical-impact defect or security issue.triage:confirmedReported defect reproduces, or requested non-bug gap is independently verified.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions