Skip to content

[runner] Keep sshd alive until the runner stops it - #4417

Merged
un-def merged 1 commit into
masterfrom
issue_4415_sshd_outlives_shutdown_signal
Oct 27, 2026
Merged

un-def merged 1 commit into
masterfrom
issue_4415_sshd_outlives_shutdown_signal

Conversation

@un-def

@un-def un-def commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

sshd was started on the runner's signal context, so a shutdown signal killed it immediately, while the runner went on waiting for the server to pull the job's final state. On backends where the server reaches the runner through the container's sshd, the pull could never happen: the server marked the job INSTANCE_UNREACHABLE after two minutes.

Detach sshd's lifetime from the caller's context and let Stop cancel it, keeping SIGTERM with the SIGKILL backstop as the only way down. Stop now checks the exit status itself, as Wait reports the cancellation in its place.

Fixes: #4415

sshd was started on the runner's signal context, so a shutdown signal
killed it immediately, while the runner went on waiting for the server
to pull the job's final state. On backends where the server reaches
the runner through the container's sshd, the pull could never happen:
the server marked the job INSTANCE_UNREACHABLE after two minutes.

Detach sshd's lifetime from the caller's context and let Stop cancel
it, keeping SIGTERM with the SIGKILL backstop as the only way down.
Stop now checks the exit status itself, as Wait reports the
cancellation in its place.

Fixes: #4415
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@un-def
un-def merged commit 1dc2571 into master Oct 27, 2026
29 checks passed
@un-def
un-def deleted the issue_4415_sshd_outlives_shutdown_signal branch October 27, 2026 10:38
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.

[Bug]: [runner] Graceful termination signal terminates sshd immediately

1 participant