Repository navigation
GH-6326: fix(executor): a held task is checked again between task runs, not only when the project queue is empty — reset heldThisCycle after each completed run, prune replaced rows, no orphan eviction of a Held or Queued row - #6339
Merged
Conversation
… rows, no orphan eviction of Held/Queued entries (GH-6326)
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Automated PR created by Pilot for task GH-6326.
Closes #6326
Changes
GitHub Issue GH-6326: fix(executor): a held task is checked again between task runs, not only when the project queue is empty — reset heldThisCycle after each completed run, prune replaced rows, no orphan eviction of a Held or Queued row
Context
A held task is not checked again until the project queue is empty. On 2026-11-10 issue #6267 was held by the base-presence check; the issue body was fixed 12 seconds after the last hold; the task was not checked again for one hour, because another task of the project ran, and 2 hours after its start the stuck-task eviction stalled its queued row. A later log line "Held task skipped in favour of runnable task" still named the task from an old entry.
Cause, in
internal/executor/dispatcher.go: processQueue of ProjectWorker creates the maps heldThisCycle (GH-5572) and transitionFailed (GH-6028) once per call. The worker is serial and runs each task inside the loop, so one call spans every runnable task of the queue, and a held row is skipped for the whole call. The maps are keyed by execution ID and never pruned. Ininternal/alerts/engine.go, evaluateStuckTasks evicts an entry older than the orphan threshold (floor 120 minutes) before the exemption for the Queued phase applies, and a repeated Held progress event does not refresh the clock, so stallOrphanedExecution stalls a row that only waits.Scope
Acceptance
go test -race -count=1 ./internal/executor/ ./internal/alerts/ -run 'ProcessQueue|BasePresence|StuckTask'passes; paste the output into the PR body.Out of scope
The base-presence check itself and its hold counter. A parallel project worker.
Refs
Not verified
go test -race -count=1 ./internal/executor/ ./internal/alerts/ -run 'ProcessQueue|BasePresence|StuckTask'passes; paste the output into the PR body.Reason: Not verified: shell operators are not allowed in evidence commands
Remove the reset of item 1 -> the test "held row runs before the queue is empty" fails.
Reason: freeform mutation, run manually
Remove the exemption of item 5 -> the Held eviction test fails.
Reason: freeform mutation, run manually
Pre-PR review
Mode: enforce
Verdict: APPROVE-WITH-NOTES
Fix: none
Defects:
Not-verified: