Repository navigation
fix(server): wait one tick before the first queued-workflow reaper pass (RIG-11227) - #192
Merged
rigel-nemo[bot] merged 1 commit intoNov 21, 2026
Conversation
…ss (RIG-11227) 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>
Contributor
Author
|
All-clear at 579c972 Review round 1: 0 high, 0 medium, 0 low.
|
|
Checks read:
|
rigel-nemo
Bot
deleted the
ci-pipelines/rig-11227-wait-one-tick-before-the-first-queued
branch
November 21, 2026 14:56
This branch had an error being deployed
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 in
forks/woodpecker/cmd/server/server.gonow waits one full tick before its first pass, so it no longer runs at server startup. Thefinalized 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.
This is a port of RigelBuild/woodpecker#181 (RIG-11227) into the nebula monorepo under
forks/woodpecker/, as part of the RIG-10145 fork archive. The old PR is closed with a pointer to this one.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(synctest, injected tick channel) andTestFinalizeDeadWorkflowsLogsFailedDependency(3-case table, including a failure-only dependent).Verification
CGO_ENABLED=0 go test -tags test -count=1 ./cmd/server/inforks/woodpecker: ok.CGO_ENABLED=1 nix shell nixpkgs#gcc -c go test -tags test -count=1 ./server/pipeline/: ok.CGO_ENABLED=0on./server/pipeline/fails withsql: unknown driver "sqlite3". Those tests use the sqlite test store, so they need cgo; the failure is not from this change.gofmt -lon the touched directories: clean.Risks
After a restart, a truly orphaned workflow is finalized up to one interval later (5m by default). Rollback: revert this commit.
Spec impact
Spec-impact: none.
Checks skipped:
nebula fork port; no local hook runnerRefs RIG-11227
Co-authored-by: Matt Wilkinson matt@rigel.build