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

Fix concurrent workers register duplicate task execution for nextstep #787

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

trihoangvo
Copy link
Contributor

Pull Request description

Description of the change

  • When one or more steps (e.g., Step1 and Step2) join one Step 3, it may happen occasionally that two workers register two duplicate task executions for one next step.
  • As a result, workers work on the duplicated executions. They create and remove ansible files from each other and cause unexpected error.
  • See bug report in Workers concurrently register execution for one step #786

What I did

  • Before registering a new task execution, a worker checks if the task execution has already been registered for the given step (at _yorc/tasks//.registeredExecutions/) When deleting the ".runningExecutions" in notifyEnd(), also delete the ".registeredExecution".

  • Note: If the step status is DONE, ERROR, or CANCELED, we still register a task execution. This is the case where we resume a workflow. The task executions are registered again. But they will be bypass if the given task status step is DONE.

How I did it

How to verify it

See Unitest. It simulates two workers register the same next step but only one task execution is registered.

Description for the changelog

Fix concurrent workers register duplicate task execution for nextstep.

Applicable Issues

… in the joined node

* When one or more steps (e.g., Step1 and Step2) join one Step 3, it may happen occasionally
  that two workers register two duplicate task executions for one next step.
  See bug report in ystia#786
* Fix: Before registering a new task execution, a worker checks if the task execution has already
  been registered for the given step (at _yorc/tasks/<taskID>/.registeredExecutions/<stepName>)
  When deleting the ".runningExecutions" in notifyEnd(), also delete the ".registeredExecution".
* Note: If the step status is DONE, ERROR, or CANCELED, we still register a task execution.
  This is the case where we resume a workflow. The task executions are registered run again.
  But they will be bypass if the given step is DONE.
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.

1 participant