Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/gh 733 action no stop #734

Merged
merged 2 commits into from
May 7, 2021
Merged

Conversation

laurentganne
Copy link
Contributor

Pull Request description

Description of the change

Fixed an issue where a workflow will be seen running forever when a synchronous step failed while an asynchronous run action is taking place at the same time. The asynchronous action was unscheduled as expected but its status was not updated and was seen as running forever.

Fixed also an issue when the asynchronous action is updating its action data: there was no check to see if the action has been unregistered, and the action data was added, leaving an isolated key in consul.

What I did

prov/scheduling/scheduler/consul_test.go
prov/scheduling/scheduler/scheduler_test.go:
Added a test on UpdateActionData()

prov/scheduling/scheduling.go:
Updating action data only when the action data deploymentID key exists

tasks/workflow/worker.go:
On task failure, call endAction()

Description for the changelog

Workflow with asynchronous action never stops after another step failure (GH-733)

Applicable Issues

Closes #733

@laurentganne laurentganne self-assigned this May 6, 2021
@laurentganne laurentganne requested a review from loicalbertin May 6, 2021 21:06
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 6, 2021

Copy link
Member

@loicalbertin loicalbertin left a comment

Choose a reason for hiding this comment

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

LGTM 👍 👏

@@ -104,7 +104,16 @@ func UnregisterAction(client *api.Client, id string) error {
// UpdateActionData updates the value of a given data within an action
func UpdateActionData(client *api.Client, id, key, value string) error {

//TODO check if action exists
scaKeyPath := path.Join(consulutil.SchedulingKVPrefix, "actions", id, "data", key)
// check if action still exists
Copy link
Member

Choose a reason for hiding this comment

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

Nice to fix TODOs 👍 😉

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.

Workflow with asynchronous action never stops after another step failure
2 participants