Repository navigation
fix(agent): stop a blocked step wait at the workflow deadline (RIG-11161) - #179
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
…161) waitForLogs drained the step log stream with an unbounded wait, so a stalled stream or a blocked log send held the step past the workflow deadline. The wait now also returns when the workflow context is done. WaitStep and the stage already honor the context. Co-Authored-By: Matt Wilkinson <matt@rigel.build> Co-authored-by: Matt Wilkinson <matt@rigel.build>
Author
|
Moved to RigelBuild/nebula#190 (RIG-10145 fork archive). |
rigel-nemo Bot
pushed a commit
to RigelBuild/nebula
that referenced
this pull request
Nov 22, 2026
…161) (#190) Make waitForLogs in pipeline/runtime/step.go return when the workflow context is done, not only when the log drain finishes. The drain was waited on with no bound, so a stalled log stream or a blocked log send could hold a step past the workflow deadline. Ported from RigelBuild/woodpecker#179. Adds step_deadline_test.go with the stalled-stream and blocked-send cases. 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
Makes
waitForLogsinpipeline/runtime/step.goreturn when the workflow context is done, not only when the log drain finishes.Why do we need it
The step log drain was waited on with no bound. A stalled log stream, or a blocked log send, could hold a step, its stage and
Runpast the workflow deadline.WaitStepand the stage already honor the context; this wait was the gap.The overrun this targets was not proven to come from the log drain: no agent logs survive for that window. The fix closes the one unbounded wait on the step path. Runs that were still writing output were killed on time, so the deadline already works when the log stream is flowing.
Summary
pipeline/runtime/step_deadline_test.gocovers a stalled stream and a blocked log send.Verification
go test -race -tags test -count=20 ./pipeline/runtime/: ok.rigel-release, cgo via nix gcc:go test -race -tags test -count=3 ./pipeline/runtime/: ok.step.gowith "workflow hung past its deadline".-race -count=50 -cpu=1,2on the deadline and step tests: ok.Risks
A step stopped at the deadline may lose its last few log lines, because destroy can close the pipe before the drain reads them. The server still accepts late lines for five minutes.
Spec impact
Spec-impact: none.
Checks skipped:
p0:RIG-9887Refs RIG-11161
Co-authored-by: Matt Wilkinson matt@rigel.build