Repository navigation
Conversation
A succeeded/cancelled run whose runner workspace is removed from the host (cleaner, disk work, manual delete) could never finish cleanup: the last checkpoint export returned 404/missing, the save failed, cleanupWorkspace returned early, WorkspaceCleanedAt was never written and the admission slot stayed held — with the sweep retrying every 20s forever (Tencent#1473). Extend the existing missing-workspace checkpoint degradation from idle SOP statuses to terminal statuses too, keeping the runner probe and checkpoint status double-confirmation so real RPC failures/offline runners still report. Also fill the runner's semantic Code (WorkspaceErrorMissing) on ErrNotExist so the platform can distinguish 'already gone' from other failures. Part of Tencent#1473; does not close the issue.
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.
fix(engine): reclaim terminal runs whose workspace disappeared
This is the #1473 slice: release the admission slot and stop the endless cleanup sweep when a finished run's runner workspace was removed from the host.
Problem
For a succeeded/cancelled run whose workspace directory was deleted externally (tmp cleaner, disk work, manual cleanup),
cleanupWorkspace()first saves a last checkpoint. The checkpoint export returned 404/missing; the existing degradation only covered idle SOP statuses (failed/waiting), so terminal runs treated it as a permanent failure:WorkspaceCleanedAtwas never written, the admission slot stayedheld, and the sweep retried every 20 seconds forever.The runner also mapped
os.ErrNotExistto HTTP 404 without a semantic error code, so the platform could not distinguish "already gone" from other failures.Change
internal/engine/workspace_checkpoint_stream.go— extend the missing-workspace checkpoint degradation fromidleSOPStatus(run)to also include terminalsucceeded/cancelled, keeping the runner probe andcheckpoint_statusdouble-confirmation. Real RPC errors and offline runners still report normally.internal/runner/workspace.go— fillCode: domain.WorkspaceErrorMissingonErrNotExist.Verification (Linux/amd64, Docker
python:3.12)go vet,git diff --check: clean. Full package suites are blocked by pre-existing container limits (nobwrap; Chromium unavailable), unrelated to this change.Scope / notes