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(controller): Fixed workflow stuck with mutex lock #4744

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

sarabala1979
Copy link
Member

Signed-off-by: Saravanan Balasubramanian sarabala1979@gmail.com

Checklist:

Fixes #4703

Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
i, holder := ms.GetHolding(lockKey)
items := strings.Split(holderKey, "/")
holdingName := items[len(items)-1]
if i >= 0 && holder.Holder == holdingName {
Copy link
Member Author

@sarabala1979 sarabala1979 Dec 15, 2020

Choose a reason for hiding this comment

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

This check will make sure who is requesting the mutex release

@@ -93,7 +93,11 @@ func (woc *wfOperationCtx) executeSteps(nodeName string, tmplCtx *templateresolu

sgNode := woc.executeStepGroup(stepGroup.Steps, sgNodeName, &stepsCtx)

if !sgNode.Fulfilled() {
if sgNode.Fulfilled() {
Copy link
Member Author

Choose a reason for hiding this comment

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

If the step template has mutex lock and will not invoke execute template to release the lock if child nodes are completed. It. has to be handled here
Eg:

- name: main-function
    synchronization:
      mutex:
        name:  config
    steps:
    - - name: check
        template: main-command
    - - name: check1
        template: main-command

@sarabala1979 sarabala1979 marked this pull request as ready for review December 15, 2020 04:50
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
@sarabala1979 sarabala1979 merged commit a1f7aed into argoproj:master Dec 15, 2020
simster7 pushed a commit that referenced this pull request Dec 15, 2020
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
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.

Workflows with mutexes get stuck
2 participants