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: Task result comparison is incorrect, leading to inconsistent comparison results. #13211

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

jswxstw
Copy link
Member

@jswxstw jswxstw commented Jun 18, 2024

Motivation

if !reflect.DeepEqual(&old, newNode) {

The variable old is *NodeStatus since #11451, so &old and newNode is always not equal now.

Modifications

use old instead of &old

Verification

local test

Workflow Demo:

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: workflow-sleep
spec:
  entrypoint: sleep
  templates:
  - name: sleep
    container:
      image: alpine:3.18
      command: [sh, -c]
      args: ["sleep 600"]`

Controller log:

INFO[2024-06-18T14:28:57.179Z] Processing workflow                           Phase= ResourceVersion=765095 namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.190Z] resolved artifact repository                  artifactRepositoryRef="argo/#"
INFO[2024-06-18T14:28:57.190Z] Task-result reconciliation                    namespace=argo numObjs=0 workflow=workflow-sleep
INFO[2024-06-18T14:28:57.190Z] Updated phase  -> Running                     namespace=argo workflow=workflow-sleep
WARN[2024-06-18T14:28:57.190Z] Node was nil, will be initialized as type Skipped  namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.191Z] was unable to obtain node for , letting display name to be nodeName  namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.191Z] Pod node workflow-sleep initialized Pending   namespace=argo workflow=workflow-sleep
WARN[2024-06-18T14:28:57.191Z] couldn't get boundaryTemplate through nodeName workflow-sleep  namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.218Z] Created pod: workflow-sleep (workflow-sleep)  namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.218Z] TaskSet Reconciliation                        namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.218Z] reconcileAgentPod                             namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:57.218Z] Workflow to be dehydrated                     Workflow Size=797
INFO[2024-06-18T14:28:57.233Z] Workflow update successful                    namespace=argo phase=Running resourceVersion=765101 workflow=workflow-sleep
INFO[2024-06-18T14:28:58.179Z] Processing workflow                           Phase=Running ResourceVersion=765101 namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:58.181Z] Task-result reconciliation                    namespace=argo numObjs=0 workflow=workflow-sleep
INFO[2024-06-18T14:28:58.181Z] node changed                                  namespace=argo new.message=PodInitializing new.phase=Pending new.progress=0/1 nodeID=workflow-sleep old.message= old.phase=Pending old.progress=0/1 workflow=workflow-sleep
INFO[2024-06-18T14:28:58.181Z] TaskSet Reconciliation                        namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:58.181Z] reconcileAgentPod                             namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:58.181Z] Workflow to be dehydrated                     Workflow Size=1052
INFO[2024-06-18T14:28:58.197Z] Workflow update successful                    namespace=argo phase=Running resourceVersion=765105 workflow=workflow-sleep
INFO[2024-06-18T14:28:59.199Z] Processing workflow                           Phase=Running ResourceVersion=765105 namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:59.200Z] Task-result reconciliation                    namespace=argo numObjs=1 workflow=workflow-sleep
INFO[2024-06-18T14:28:59.200Z] node unchanged                                namespace=argo nodeID=workflow-sleep workflow=workflow-sleep
INFO[2024-06-18T14:28:59.200Z] TaskSet Reconciliation                        namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:28:59.200Z] reconcileAgentPod                             namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:00.461Z] Processing workflow                           Phase=Running ResourceVersion=765105 namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:00.462Z] Task-result reconciliation                    namespace=argo numObjs=1 workflow=workflow-sleep
INFO[2024-06-18T14:29:00.462Z] node changed                                  namespace=argo new.message= new.phase=Running new.progress=0/1 nodeID=workflow-sleep old.message=PodInitializing old.phase=Pending old.progress=0/1 workflow=workflow-sleep
INFO[2024-06-18T14:29:00.462Z] TaskSet Reconciliation                        namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:00.462Z] reconcileAgentPod                             namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:00.462Z] Workflow to be dehydrated                     Workflow Size=1057
INFO[2024-06-18T14:29:00.478Z] Workflow update successful                    namespace=argo phase=Running resourceVersion=765116 workflow=workflow-sleep
INFO[2024-06-18T14:29:01.479Z] Processing workflow                           Phase=Running ResourceVersion=765116 namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:01.480Z] Task-result reconciliation                    namespace=argo numObjs=1 workflow=workflow-sleep
INFO[2024-06-18T14:29:01.480Z] node unchanged                                namespace=argo nodeID=workflow-sleep workflow=workflow-sleep
INFO[2024-06-18T14:29:01.480Z] TaskSet Reconciliation                        namespace=argo workflow=workflow-sleep
INFO[2024-06-18T14:29:01.480Z] reconcileAgentPod                             namespace=argo workflow=workflow-sleep

Logs like task-result changed does not appear again.
ResourceVersion in logs like Workflow update successful is different.

…parison results.

Signed-off-by: oninowang <oninowang@tencent.com>
@agilgur5 agilgur5 added the area/controller Controller issues, panics label Jun 18, 2024
@jswxstw
Copy link
Member Author

jswxstw commented Aug 22, 2024

@isubasinghe Can you take a look at this? A very minor modification, but it can save unnecessary workflow updates.

@juliev0 juliev0 merged commit ddbb3c7 into argoproj:main Aug 23, 2024
29 checks passed
@agilgur5 agilgur5 requested a review from Joibel September 5, 2024 00:55
Joibel pushed a commit to pipekit/argo-workflows that referenced this pull request Sep 19, 2024
…parison results. (argoproj#13211)

Signed-off-by: oninowang <oninowang@tencent.com>
Joibel pushed a commit that referenced this pull request Sep 20, 2024
…parison results. (#13211)

Signed-off-by: oninowang <oninowang@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants