conductor icon indicating copy to clipboard operation
conductor copied to clipboard

EVENT task executes twice, if asyncComplete is specified to true (2 events are sent at once)

Open anaken opened this issue 3 years ago • 3 comments

Description of the bug A task of the type EVENT sends 2 events at once if it has property asyncComplete is specified to true

Details Conductor version: 3.11.3

To Reproduce Example workflow:

{
  "name": "testEventWF",
  "description": "testEventWF",
  "version": 1,
  "tasks": [
    {
      "name": "sendEvent",
      "taskReferenceName": "sendEvent",
      "inputParameters": {
        "value": "test"
      },
      "sink": "conductor:test",
      "type": "EVENT",
      "asyncComplete": true
    }
  ],
  "inputParameters": [],
  "outputParameters": {
  },
  "schemaVersion": 2,
  "restartable": true,
  "workflowStatusListenerEnabled": false,
  "ownerEmail": "[email protected]",
  "timeoutPolicy": "ALERT_ONLY",
  "timeoutSeconds": 0
}

Expected behavior Only one event should be sent at once

Additional context Looks like the problem is in the recursive call of method com.netflix.conductor.core.execution.WorkflowExecutor::decide(WorkflowModel) when the state of task changes. WorkflowExecutor.java#L1367

anaken avatar Sep 30 '22 12:09 anaken

@anaken I couldn't reproduce the bug using the workflow that you posted. Does the EVENT task publish events twice every time or is it sporadic?The one in the ticket seems to be a sample, it would be helpful if you can post the original workflow. Its quite possible that this behavior only happens for a particular combination of tasks.

aravindanr avatar Oct 03 '22 21:10 aravindanr

Hi @aravindanr , This is reproducible when we use sqs or amqp as a queue. I have to check when using conductor as queue @anaken , We are working on a fix.

manan164 avatar Nov 01 '22 08:11 manan164

Hi @anaken , PR for the fix https://github.com/Netflix/conductor/pull/3331

manan164 avatar Nov 02 '22 09:11 manan164