Skip to content

Preserve child exit status during restart - #4

Merged
dentarg merged 1 commit into
mainfrom
fix/exit-status-race
Sep 13, 2026
Merged

dentarg merged 1 commit into
mainfrom
fix/exit-status-race

Conversation

@dentarg

@dentarg dentarg commented Sep 13, 2026

Copy link
Copy Markdown
Member

Startup detaches the child while shutdown separately waits for the same PID. If shutdown reaps it first, the detached waiter returns nil and exit mode crashes when checking success?. Share the detached waiter between both paths so only one thread collects the exit status.

Keep signal timeouts and escalation intact. Add a regression spec for the lost-status race and document the fix in the changelog and fork history.

Docker tests pass with 101 examples, no failures, and five existing pending specs. Also verify 100 real-child shutdowns and TERM-to-KILL escalation with the exit status retained.

Fixes #1

Startup detaches the child while shutdown separately waits for the same
PID. If shutdown reaps it first, the detached waiter returns nil and
exit mode crashes when checking success?. Share the detached waiter
between both paths so only one thread collects the exit status.

Keep signal timeouts and escalation intact. Add a regression spec for
the lost-status race and document the fix in the changelog and fork
history.

Docker tests pass with 101 examples, no failures, and five existing
pending specs. Also verify 100 real-child shutdowns and TERM-to-KILL
escalation with the exit status retained.

Fixes #1
@dentarg
dentarg force-pushed the fix/exit-status-race branch from 8c4c403 to f36db09 Compare September 13, 2026 23:19
@dentarg
dentarg merged commit 41020ff into main Sep 13, 2026
12 checks passed
@dentarg
dentarg deleted the fix/exit-status-race branch September 13, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

undefined method 'success?' for nil:NilClass (NoMethodError)

1 participant