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: Fixed memoization is unchecked after mutex synchronization. Fixes #11219 #11578

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

shmruin
Copy link
Contributor

@shmruin shmruin commented Aug 15, 2023

Fixes #11219 (cherry-pick of #11456)

Motivation

This is cherry-pick of #11456, which is already merged in master branch.

Modifications

Same as before but two things changed to resolve conflicts.

  1. woc.wf.Status.Nodes.Set to woc.wf.Status.Nodes[...] because Set is not applied.
  2. In executeTemplate, woc.markNodeWaitingForLock(node.Name, lockName.EncodeName()) to woc.markNodeWaitingForLock(node.Name, lockName.EncodeName()), nil which is also not applied factor in this release.

Verification

Verify with same test code as below in UI, and with test code in operator_concurrency_test.go

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: example-steps-simple
spec:
  entrypoint: main

  templates:
    - name: main
      steps:
        - - name: job-1
            template: sleep
            arguments:
              parameters:
                - name: sleep_duration
                  value: 30
          - name: job-2
            template: sleep
            arguments:
              parameters:
                - name: sleep_duration
                  value: 15

    - name: sleep
      synchronization:
        mutex:
          name: mutex-example-steps-simple
      inputs:
        parameters:
          - name: sleep_duration
      script:
        image: alpine:latest
        command: [/bin/sh]
        source: |
          echo "Sleeping for {{ inputs.parameters.sleep_duration }}"
          sleep {{ inputs.parameters.sleep_duration }}
      memoize:
        key: "memo-key-1"
        cache:
          configMap:
            name: cache-example-steps-simple

@terrytangyuan terrytangyuan merged commit bd6cd25 into argoproj:release-3.4.10 Aug 15, 2023
2 checks passed
@shmruin shmruin deleted the release-3.4.10 branch August 18, 2023 16:04
@agilgur5 agilgur5 added area/mutex-semaphore area/memoization type/backport Backport of an existing PR to an older release branch labels Mar 9, 2024
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/memoization area/mutex-semaphore type/backport Backport of an existing PR to an older release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants