Repository navigation
fix(server): wait one tick before the first queued-workflow reaper pass (RIG-11227) - #181
Closed
rigel-mintaka wants to merge 1 commit into
Closed
rigel-mintaka wants to merge 1 commit into
rigel-mintaka wants to merge 1 commit into
Conversation
…ss (RIG-11227) A restart reaped the whole persisted backlog in its first pass, finalizing 74 queued workflows as dependency-failed at once. The reaper now waits one interval before its first pass, and the dependency-failed finalize log names the failing dependency workflow ID. Co-Authored-By: Matt Wilkinson <matt@rigel.build> Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
|
Review round 1 (opus
Fork CI will be red until RIG-11518 (the Petrel replay 403) is fixed; that is not caused by this change. All-clear at 4fad3bd |
Author
|
All-clear at 4fad3bd |
Author
|
Moved to RigelBuild/nebula#192 (RIG-10145 fork archive). |
rigel-nemo Bot
pushed a commit
to RigelBuild/nebula
that referenced
this pull request
Nov 21, 2026
…ss (RIG-11227) (#192) The orphan reaper ran once at server startup, before agents had reconnected, and could finalize workflows that were still alive. The inline loop becomes runOrphanReaper, which waits one tick before its first pass. The interval is unchanged. The finalized queued workflow log line now carries dependency_workflow_id, the dependency that blocked the workflow. Ported from RigelBuild/woodpecker#181. Co-authored-by: Matt Wilkinson <matt@rigel.build>
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.
What does this do
The queued-workflow reaper now waits one full tick before its first pass, so it no longer runs at server startup. The
finalized queued workflowlog line now names the dependency that blocked the workflow (dependency_workflow_id).Why do we need it
When the server restarts, agents have not reconnected yet. A reaper pass at that moment can finalize workflows that are still alive. When the reaper does finalize a workflow, the log line did not say which dependency caused it, which made stalls hard to trace.
Summary
cmd/server/server.go: the inline loop becomesrunOrphanReaper(ctx, ticks, reap). Nothing runs before the first tick. The interval is unchanged.server/pipeline/pending_timeout.go: the newfailedDependencyhelper returns the first dependency whose status alone makesShouldRun()false, and the finalize log carries it.TestRunOrphanReaperWaitsOneTickBeforeFirstPass, usingsynctestand an injected tick channel, andTestFinalizeDeadWorkflowsLogsFailedDependency, a 3-case table that includes a failure-only dependent.Verification
CGO_ENABLED=1 go test -count=1 -tags test ./cmd/server ./server/pipeline: ok for both packages.Risks
After a restart, a truly orphaned workflow is finalized up to one interval later (5m by default).
Spec impact
Spec-impact: none.
Checks skipped:
macpro2013 paused (RIG-11141); package tests ran locally with CGO=1 and passedRefs RIG-11227
Co-authored-by: Matt Wilkinson matt@rigel.build