Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Bug: Fix pipeline run complete state machine#4053

Merged
briancain merged 4 commits into
mainfrom
bug/pipeline_run/fix-complete-pipeline
Oct 17, 2022
Merged

Bug: Fix pipeline run complete state machine#4053
briancain merged 4 commits into
mainfrom
bug/pipeline_run/fix-complete-pipeline

Conversation

@briancain

@briancain briancain commented Oct 14, 2022

Copy link
Copy Markdown
Contributor

This pull request fixes a bug where the boltdb state for a pipeline run would never mark a finished pipeline as success and would be stuck in running forever. It fixes it by looking at all job references on a run and seeing if they are also complete before marking the pipeline as complete.

Fixes #4032

Prior to this commit, when we'd go to complete a pipeline run, we would
only look at the "last" job in the jobs slice for a pipeline run
message. This check doesn't seem to work anymore, and relying on the
last job in a slice can be fragile. This commit fixes this behavior by
checking all job ids in a pipeline run and seeing if they have finished
as well before attempting to mark the pipeline run as a success.

Fixes #4032
@briancain briancain added the pr/no-changelog No automatic changelog entry required for this pull request label Oct 14, 2022
@briancain briancain requested review from a team, catsby and xiaolin-ninja October 14, 2022 16:48
@github-actions github-actions Bot added the core label Oct 14, 2022
Comment thread internal/server/boltdbstate/job.go
Comment thread pkg/server/gen/server.swagger.json Outdated

@xiaolin-ninja xiaolin-ninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we're already hitting the edge case, left my thoughts on the loop & a rewording suggestion.

@xiaolin-ninja xiaolin-ninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! Looks good to me for a temporary fix until something more efficient comes along. :)

Base automatically changed from feat/pipelines/reattach-pipeline-run to main October 17, 2022 20:41
@briancain briancain merged commit 5f63cd6 into main Oct 17, 2022
@briancain briancain deleted the bug/pipeline_run/fix-complete-pipeline branch October 17, 2022 20:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/0.10.x core pr/no-changelog No automatic changelog entry required for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pipelines: Pipeline Run state machine isn't updating on completion

3 participants