Set workflow services stuck in running state to finished#6337
Merged
Conversation
When a workflow includes service steps, the workflow and pipeline status is permanently stuck as "running" in the database after all steps had finished. completeChildrenIfParentCompleted was called after UpdateWorkflowStatusToDone, so the status calculation still saw service steps as running. The in-memory step state also wasn't updated after the database update. The fix moves child completion before the status calculation and syncs the in-memory state so WorkflowStatus sees the finalized step states. I think this bug was introduced in the refactoring in woodpecker-ci#6011
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6337 +/- ##
==========================================
+ Coverage 34.12% 34.14% +0.01%
==========================================
Files 423 423
Lines 28460 28466 +6
==========================================
+ Hits 9712 9719 +7
+ Misses 17862 17859 -3
- Partials 886 888 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Ah nice, didn’t see that. Thanks. I’ll test again when #6320 is merged. |
Member
|
ok now the refactoring is merged and i finished #6320 ... this works in the same domain but it looks like it solves something different 😅 |
Member
|
well #6263 should make it so the final done is only returned once the detached/services did report back there status. still this here is a nice bugfix, fixing it now and harden the server later on :) |
6543
approved these changes
Mar 30, 2026
This was referenced Mar 30, 2026
Merged
Merged
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.
When a workflow includes service steps, the workflow and pipeline status is permanently stuck as "running" in the database after all steps had finished.
completeChildrenIfParentCompleted was called after UpdateWorkflowStatusToDone, so the status calculation still saw service steps as running. The in-memory step state also wasn't updated after the database update.
The fix moves child completion before the status calculation and syncs the in-memory state so WorkflowStatus sees the finalized step states.
I think this bug was possibly introduced in #6011