[BUG] Realm retirement releases ownership before the terminal event is consumed #6
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/launchd#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Successful running-realm retirement can release Launchd's original child owner before its queued terminal event is consumed. Procd queues a visible RealmMediator event before acknowledging final retirement. Launchd blocks ordinary WAIT while retiring, then releases the realm record immediately after replying to public ABORT. A later valid event can therefore match neither a retained realm nor an ordinary job and stop the dispatcher.
This is a source-confirmed lifetime gap found while reviewing native acceptance criteria. It is separate from both the repaired WAIT role decoder and the current earlier START failure. No actual guest failure caused by this post-retirement path is claimed.
Reproduction
At Launchd
eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68dand Procdd04311abff67e7355bd92bb2e48fb6161e0ec674:This ordering follows the retained-owner gate: ordinary process-event intake is paused while the native retirement owner remains pending. A never-started staged abort is a different path and need not generate this running terminal event.
Expected and actual behavior
The original child generation must remain attributable until both final native retirement and its visible terminal-event obligation have a coherent acknowledgment. Later service requests must continue after either explicit retirement or unsolicited child termination. The correction must not discard arbitrary unmatched events or use untrusted scalar identifiers as authority.
Procd's running realm retirement unconditionally queues an event before it becomes eligible for a Retired response. Unlike ordinary Launchd STOP, it does not remove that exact queued event as part of acknowledgment. Launchd then clears its realm record. When ordinary WAIT resumes, the repaired decoder accepts the RealmMediator role, but the dispatcher cannot find the former realm owner and falls through to ordinary-job lookup, which errors for the mediator. This can produce a ProcessEvent fail-stop after an otherwise successful public retirement.
Environment and identity
eb2a1eedabe66e01ab0eb8c630d2f06ecb67b68d; Procdd04311abff67e7355bd92bb2e48fb6161e0ec674; selected Integrationfa857c0964774def6777142afeb7a3c16440abee; Kernel5e285aa91a1423523b2a094d4ce0449ada39b16c; Posixd809647d60544c4c6121868c99133f30d054965c9.Evidence and prior checks
The unchanged two-mediator scenario checks startup, independent acknowledged retirement and stale public reads, but has no explicit terminal-event-consumption acknowledgment. A positive ABORT reply alone cannot prove the repaired WAIT decoder was exercised; a completed powerbox expiration can also consume its work-class turn before WAIT runs. Host regression and source-bound native event evidence remain required. No runtime execution, retry or timeout change was performed for this review.
Tracking
Launchd lifecycle audit, Launchd PR 2, Posixd realm lifecycle, Integration validation, and Phase 6 completion. The WAIT decoder defect covers admissible event roles; this report covers lifetime of the owner after decoding. The earlier START failure currently prevents native execution from reaching this boundary.
Producer ownership refinement: the owning correction is tracked in Procd 7 and Procd PR 2. After proving the original child's terminal disposition and capability cleanup, explicit RETIRE must consume only its exact queued visible event before completing its retained successful response, analogous to ordinary STOP. Unrelated generations and spontaneous terminal events remain available to WAIT. Launchd must not wait unconditionally for a second event because a rejected or lost start can still concern a never-started staged child. No unmatched-event swallowing or inferred replacement owner is required. This report remains open as the downstream symptom and acceptance record.
erikinkinen referenced this issue from erix/integration2026-09-24 20:11:14 +02:00
erikinkinen referenced this issue from erix/docs2026-09-24 20:38:25 +02:00