Repository navigation
fix(supervise): skrog start right after wsl --shutdown is a start (#530) - #531
Merged
Merged
Conversation
…t an outside stop (#530) skrog start now leaves a fresh start-request token the supervisor always sees as a change. A start request it has not seen yet overrides the #518 outside-stop verdict, including when it lands during the distro probe. A request consumed while the engine runs is spent, so a later wsl --shutdown still sticks.
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.
skrog startnow writes a start-request token (start-requestin the state dir, a fresh value on every call) along with desired state and the idle marker. The supervisor watches the token as part of its intent poke and consumes it on every reconcile. When a start request it hasn't seen yet meets a down engine, that's a start:sawUpis cleared, so the wsl --shutdown should stick: go idle instead of restarting the engine #518 outside-stop verdict doesn't fire.A request consumed while the engine is running is spent at that point. A later
wsl --shutdownstill sticks, as #518 intends.Verification
New tests in
internal/supervise/outsidestop_test.go:TestStartRightAfterAnOutsideShutdownIsAStartreproduces the nightly failure. Before the fix, with the exact writes the oldskrog startmade, it failed withstarted 0 times ..., want 1andengine recorded as idle.TestStartDuringTheDistroProbeIsAStartcovers a start that arrives mid-probe.TestStartWhileRunningDoesNotOverrideALaterShutdownchecks that a stale request doesn't undo a later shutdown.Negative controls, run locally with each piece reverted in turn:
scripts/lint.ps1: shellcheck, gofmt, vet, build and tests pass locally. govulncheck fails locally on Go 1.27.1 standard-library advisories ininternal/bundleandinternal/upgrade, which this change doesn't touch.The unit tests can't hit the real timing. The e2e workflow will be dispatched on this branch more than once before merge, since a single green run of an intermittent failure doesn't prove much.
Closes #530.