Skip to content

fix: scope shutdown to the original process attempt - #595

Open
imshah-id wants to merge 1 commit into
F1bonacc1:mainfrom
imshah-id:fix/stop-original-process-attempt
Open

imshah-id wants to merge 1 commit into
F1bonacc1:mainfrom
imshah-id:fix/stop-original-process-attempt

Conversation

@imshah-id

Copy link
Copy Markdown

Closes #592.

When a readiness probe stops a child, that child can exit and be replaced before the stop timeout expires. The timeout was waiting for the whole restart loop and reading the current command at the end, so it could send SIGKILL to the replacement.

Bind each stop to the original command and its completion channel. A regression sends the same internal stop used by the readiness probe, then checks that the wait finishes promptly and the restarted child stays running. Before the fix, the old stop timed out and killed the replacement.

go test ./... passed on macOS arm64. The focused stop and readiness regressions passed three runs under the race detector. The full make testrace found a race in watcher setup and teardown in TestWatch_ExitOnEndSurvivesRestart; the same race reproduced on unchanged main at 190d026.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

Readiness-triggered shutdown timeout kills the automatically restarted replacement

1 participant