Skip to content

Fix workflow stop issue#4125

Merged
demmer merged 4 commits intovitessio:masterfrom
tinyspeck:fix-workflow-stop-issue
Aug 9, 2018
Merged

Fix workflow stop issue#4125
demmer merged 4 commits intovitessio:masterfrom
tinyspeck:fix-workflow-stop-issue

Conversation

@rafael
Copy link
Copy Markdown
Member

@rafael rafael commented Aug 7, 2018

Desc

This fixes a small but annoying where trying to Stop a workflow that was waiting approval for a Sequential step just hangs.

This was due to not having enough semaphores in the running tasks loops. I fixed this by just returning the whole method early if the context is done.

Tests

  • Added unit test, but also test the fix in our environment.

Rafael Chacon added 2 commits August 7, 2018 16:40
…eing block

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
nit - formatting issue

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@rafael rafael requested a review from demmer August 7, 2018 23:44
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Copy link
Copy Markdown
Member

@demmer demmer left a comment

Choose a reason for hiding this comment

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

LGTM with one minor logging suggestion

select {
case <-p.ctx.Done():
log.Info("Workflow is cancelled, will not run task: %v", task)
log.Infof("Workflow is cancelled, will not run task: %v", task)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This log message is somewhat misleading since it will not run this task or all subsequent ones, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah that is correct. How would you phrase it?

Maybe just:

log.Infof("Workflow is cancelled, current task and subsequent tasks will be aborted")  

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@demmer demmer merged commit 8748713 into vitessio:master Aug 9, 2018
@rafael rafael deleted the fix-workflow-stop-issue branch August 9, 2018 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants