Repository navigation
fix(kubernetes): a restart that outlasts its bootstrap grace is a lost runtime - #18
Merged
Merged
Conversation
…t runtime A non-create bootstrap unfinished after the 5-minute grace was suspended fail-closed, which is permanent and looks like a deliberate stop. A restart is meant to end up running, so it now suspends as RuntimeLost, and the gateway starts a fresh generation under its restart backoff. The workload is suspended either way. A stale stop stays fail-closed. Every fail-closed suspension now logs at ERROR, since nothing else records why a sandbox stopped. Hardening from ENG-11690, whose cause is still unconfirmed: a 330s Pending restart on kind did not reach this path, because regeneration every 2 minutes resets the timer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XY4mbnSV5mNkx9Hjg4qhdn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardening from Node rotation left an agent permanently Stopped (ENG-11690). This is not a confirmed fix for that outage; its cause is still unknown, and the ticket stays open.
Background
On 2026-11-02 a node rotation left oncall-triage recorded as
STOPPEDfor about 8 hours. ItsSandboxwasSuspendedwith nosandbox-runtime-suspension-causeannotation, and no driver operation was pending. That state is what aFailClosedsuspension produces: permanent, and indistinguishable from a deliberate stop. The log line that would say which path did it was on a gateway that no longer exists.Changes
Both are in
reap_stale_sandbox_runtime_bootstrapand the suspension helper in the Kubernetes driver.restartbootstrap is now a lost runtime. Until now, a non-create bootstrap unfinished after the 5-minute grace was suspended asFailClosed. A restart is meant to end up running, so it now suspends asRuntimeLost, and the gateway starts a fresh generation under its existing restart backoff. The workload is suspended in both cases, so an agent still never runs without its supervisor. A stalestop, or a bootstrap with no recorded operation, stays fail-closed.ERROR, with the sandbox and the bootstrap operation, so the next one says what happened. The stale-bootstrap warning also names the operation, and its text changes fromsuspending stale sandbox-runtime restart bootstraptosuspending stale sandbox-runtime bootstrap.What this does and doesn't cover
This closes one path to a permanent stop. It may not be the path taken on 11-02:
ERROR.A restart that can never become ready now retries indefinitely under backoff instead of stopping. That's the behaviour we want for agents, but it is a change from upstream's fail-closed choice for this path.
Testing
stale_restart_bootstrap_is_a_lost_runtime_and_a_stale_stop_stays_stopped.cargo test -p openshell-driver-kubernetes --lib: 297 passed.cargo clippy -p openshell-driver-kubernetes --all-targets -D warningsandcargo fmt --check: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01XY4mbnSV5mNkx9Hjg4qhdn