runner: clean up containers after termination - #84
Open
chunga-ict wants to merge 4 commits into
Open
chunga-ict wants to merge 4 commits into
chunga-ict wants to merge 4 commits into
Conversation
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.
Summary
docker runclient exitsProblem
exec.CommandContextcan terminate thedocker runclient while the Docker daemon is still processing the create request. The existing one-shotdocker rm -fmay run before the container exists, allowing a target container to appear after Leash exits. In addition, the CLI only subscribed to SIGINT, so timeout/process supervisors using SIGTERM did not enter the intended cancellation path.The reconciliation loop is only enabled when target launch did not complete normally, so normal successful sessions do not pay the added wait.
Tests
go test ./internal/runner -count=1go test -race ./internal/runner -run "TestTerminationSignalsIncludeInterruptAndTerminate|TestStopContainers|TestFinalizeSession" -count=1Both pass.
go test ./...was also attempted in a clean Go container. It is blocked by repository build prerequisites unrelated to this patch: missing generated LSM bindings (loadLsmOpen,loadLsmExec, andloadLsmConnect) and the Control UI embed assets. The runner package itself passes in full. A full runner race run additionally exposes a pre-existing race around the globalcommandOutputoverride between parallel upstream tests; the new targeted race tests pass.