I have a pipeline with two tasks. Task 2 depends on Task 1 and maxActiveInstances is set to 1 for both tasks. Despite this dependency, under certain circumstances, Task 2 runs at the same time as Task 1. For example, if Task 2 takes too long and the scheduled start time of the pipeline's next execution is reached, Task 1 starts running at the same time. Same thing happens in case of backfilling.
Since these two tasks interfere with each other, I don't want them to run at the same time under any circumstances. Ideally, I'd want only want instance of the pipeline (not individual tasks) to run at a time. But I can't figure out how to do that.
Here's what the pipeline looks like with uninteresting parts replaced with ...:
{
"objects": [
{
"period": "15 Minutes",
"name": "Every 15 minutes",
"id": "DefaultSchedule",
"type": "Schedule",
"startAt": "FIRST_ACTIVATION_DATE_TIME"
},
{
"failureAndRerunMode": "CASCADE",
"resourceRole": "...",
"role": "...",
"pipelineLogUri": "...",
"scheduleType": "cron",
"schedule": {
"ref": "DefaultSchedule"
},
"maxActiveInstances": "1",
"name": "Default",
"id": "Default"
},
{
"name": "CopyTablesActivity",
"id": "CopyTablesActivity",
"workerGroup": "dp01",
"type": "ShellCommandActivity",
"command": "..."
},
{
"name": "CreateReportsActivity",
"id": "CreateReportsActivity",
"workerGroup": "dp01",
"type": "ShellCommandActivity",
"command": "...",
"dependsOn": {
"ref": "CopyTablesActivity"
}
}
],
"parameters": [...]
}