You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/batch/batch-task-dependencies.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Some scenarios where task dependencies are useful include:
14
14
15
15
- MapReduce-style workloads in the cloud.
16
16
- Jobs whose data processing tasks can be expressed as a directed acyclic graph (DAG).
17
-
-Pre-rendering and post-rendering processes, where each task must complete before the next task can begin.
17
+
-Prerendering and post-rendering processes, where each task must complete before the next task can begin.
18
18
- Any other job in which downstream tasks depend on the output of upstream tasks.
19
19
20
20
By default, dependent tasks are scheduled for execution only after the parent task has completed successfully. You can optionally specify a [dependency action](#dependency-actions) to override the default behavior and run the dependent task even if the parent task fails.
@@ -48,7 +48,7 @@ new CloudTask("Flowers", "cmd.exe /c echo Flowers")
48
48
},
49
49
```
50
50
51
-
This code snippet creates a dependent task with task ID "Flowers". The "Flowers" task depends on tasks "Rain" and "Sun". Task "Flowers" will be scheduled to run on a compute node only after tasks "Rain" and "Sun" have completed successfully.
51
+
This code snippet creates a dependent task with task ID "Flowers". The "Flowers" task depends on tasks "Rain" and "Sun". Task "Flowers" will be scheduled to run on a compute node only after tasks "Rain" and "Sun" are completed successfully.
52
52
53
53
> [!NOTE]
54
54
> By default, a task is considered to be completed successfully when it is in the completed state and its exit code is `0`. In Batch .NET, this means a [CloudTask.State](/dotnet/api/microsoft.azure.batch.cloudtask.state) property value is `Completed` and the CloudTask's [TaskExecutionInformation.ExitCode](/dotnet/api/microsoft.azure.batch.taskexecutioninformation.exitcode) property value is `0`. To learn how to change this, see the [Dependency actions](#dependency-actions) section.
@@ -60,13 +60,13 @@ There are three basic task dependency scenarios that you can use in Azure Batch:
60
60
| Scenario | Example | Illustration |
61
61
|:---:| --- | --- |
62
62
|[One-to-one](#one-to-one)|*taskB* depends on *taskA* <p/> *taskB* won't be scheduled for execution until *taskA* has completed successfully |:::image type="content" source="media/batch-task-dependency/01_one_to_one.png" alt-text="Diagram showing the one-to-one task dependency scenario."::: |
63
-
|[One-to-many](#one-to-many)|*taskC* depends on both *taskA* and *taskB* <p/> *taskC* won't be scheduled for execution until both *taskA* and *taskB*have completed successfully |:::image type="content" source="media/batch-task-dependency/02_one_to_many.png" alt-text="Diagram showing the one-to-many task dependency scenario."::: |
64
-
|[Task ID range](#task-id-range)|*taskD* depends on a range of tasks <p/> *taskD* won't be scheduled for execution until the tasks with IDs *1* through *10*have completed successfully |:::image type="content" source="media/batch-task-dependency/03_task_id_range.png" alt-text="Diagram showing the task ID range task dependency scenario."::: |
63
+
|[One-to-many](#one-to-many)|*taskC* depends on both *taskA* and *taskB* <p/> *taskC* won't be scheduled for execution until both *taskA* and *taskB*are completed successfully |:::image type="content" source="media/batch-task-dependency/02_one_to_many.png" alt-text="Diagram showing the one-to-many task dependency scenario."::: |
64
+
|[Task ID range](#task-id-range)|*taskD* depends on a range of tasks <p/> *taskD* won't be scheduled for execution until the tasks with IDs *1* through *10*are completed successfully |:::image type="content" source="media/batch-task-dependency/03_task_id_range.png" alt-text="Diagram showing the task ID range task dependency scenario."::: |
65
65
66
66
> [!TIP]
67
-
> You can create **many-to-many** relationships, such as where tasks C, D, E, and F each depend on tasks A and B. This is useful, for example, in parallelized preprocessing scenarios where your downstream tasks depend on the output of multiple upstream tasks.
67
+
> You can create **many-to-many** relationships, such as where tasks C, D, E, and F each depend on tasks A and B. It's useful, for example, in parallelized preprocessing scenarios where your downstream tasks depend on the output of multiple upstream tasks.
68
68
>
69
-
> In the examples in this section, a dependent task runs only after the parent tasks complete successfully. This behavior is the default behavior for a dependent task. You can run a dependent task after a parent task fails by specifying a [dependency action](#dependency-actions) to override the default behavior.
69
+
> In the examples in this section, a dependent task runs only after the parent tasks complete successfully. It's the default behavior for a dependent task. You can run a dependent task after a parent task fails by specifying a [dependency action](#dependency-actions) to override the default behavior.
70
70
71
71
### One-to-one
72
72
@@ -101,7 +101,7 @@ new CloudTask("Flowers", "cmd.exe /c echo Flowers")
101
101
```
102
102
103
103
> [!IMPORTANT]
104
-
> Your dependent task creation will fail if the combined length of parent task IDs is greater than 64000 characters. To specify a large number of parent tasks, consider using a Task ID range instead.
104
+
> Your dependent task creation fails if the combined length of parent task IDs is greater than 64,000 characters. To specify a large number of parent tasks, consider using a Task ID range instead.
105
105
106
106
### Task ID range
107
107
@@ -110,9 +110,9 @@ In a dependency on a range of parent tasks, a task depends on the completion of
110
110
To create the dependency, provide the first and last task IDs in the range to the [TaskDependencies.OnIdRange](/dotnet/api/microsoft.azure.batch.taskdependencies.onidrange) static method when you populate the [CloudTask.DependsOn](/dotnet/api/microsoft.azure.batch.cloudtask.dependson) property.
111
111
112
112
> [!IMPORTANT]
113
-
> When you use task ID ranges for your dependencies, only tasks with IDs representing integer values will be selected by the range. For example, the range `1..10`will select tasks `3` and `7`, but not `5flamingoes`.
113
+
> When you use task ID ranges for your dependencies, only tasks with IDs representing integer values are selected by the range. For example, the range `1..10`selects tasks `3` and `7`, but not `5flamingoes`.
114
114
>
115
-
> Leading zeroes are not significant when evaluating range dependencies, so tasks with string identifiers `4`, `04` and `004`will all be *within* the range, Since they will all be treated as task `4`, the first one to complete will satisfy the dependency.
115
+
> Leading zeroes aren't significant when evaluating range dependencies, so tasks with string identifiers `4`, `04`, and `004`are *within* the range, Since they're all treated as task `4`, the first one to complete satisfies the dependency.
116
116
>
117
117
> For the dependent task to run, every task in the range must satisfy the dependency, either by completing successfully or by completing with a failure that is mapped to a [dependency action](#dependency-actions) set to **Satisfy**.
118
118
@@ -136,28 +136,28 @@ new CloudTask("4", "cmd.exe /c echo 4")
136
136
137
137
## Dependency actions
138
138
139
-
By default, a dependent task or set of tasks runs only after a parent task has completed successfully. In some scenarios, you may want to run dependent tasks even if the parent task fails. You can override the default behavior by specifying a *dependency action* that indicates whether a dependent task is eligible to run.
139
+
By default, a dependent task or set of tasks runs only after a parent task is completed successfully. In some scenarios, you may want to run dependent tasks even if the parent task fails. You can override the default behavior by specifying a *dependency action* that indicates whether a dependent task is eligible to run.
140
140
141
141
For example, suppose that a dependent task is awaiting data from the completion of the upstream task. If the upstream task fails, the dependent task may still be able to run using older data. In this case, a dependency action can specify that the dependent task is eligible to run despite the failure of the parent task.
142
142
143
143
A dependency action is based on an exit condition for the parent task. You can specify a dependency action for any of the following exit conditions:
144
144
145
-
-When a pre-processing error occurs.
146
-
-When a file upload error occurs. If the task exits with an exit code that was specified via **exitCodes** or **exitCodeRanges**, and then encounters a file upload error, the action specified by the exit code takes precedence.
147
-
-When the task exits with an exit code defined by the **ExitCodes** property.
148
-
-When the task exits with an exit code that falls within a range specified by the **ExitCodeRanges** property.
149
-
- The default case, if the task exits with an exit code not defined by **ExitCodes** or **ExitCodeRanges**, or if the task exits with a pre-processing error and the **PreProcessingError** property is not set, or if the task fails with a file upload error and the **FileUploadError** property is not set.
145
+
-Whenever a pre-processing error occurs.
146
+
-Whenever a file upload error occurs. If the task exits with an exit code that was specified via **exitCodes** or **exitCodeRanges**, and then encounters a file upload error, the action specified by the exit code takes precedence.
147
+
-Whenever the task exits with an exit code defined by the **ExitCodes** property.
148
+
-Whenever the task exits with an exit code that falls within a range specified by the **ExitCodeRanges** property.
149
+
- The default case, if the task exits with an exit code not defined by **ExitCodes** or **ExitCodeRanges**, or if the task exits with a pre-processing error and the **PreProcessingError** property isn't set, or if the task fails with a file upload error and the **FileUploadError** property isn't set.
150
150
151
151
For .NET, these conditions are defined as properties of the [ExitConditions](/dotnet/api/microsoft.azure.batch.exitconditions) class.
152
152
153
-
To specify a dependency action, set the [ExitOptions.DependencyAction](/dotnet/api/microsoft.azure.batch.exitoptions.dependencyaction) property for the exit condition to one of the following:
153
+
To specify a dependency action, set the [ExitOptions.DependencyAction](/dotnet/api/microsoft.azure.batch.exitoptions.dependencyaction) property for the exit condition to one of the following options:
154
154
155
155
-**Satisfy**: Indicates that dependent tasks are eligible to run if the parent task exits with a specified error.
156
-
-**Block**: Indicates that dependent tasks are not eligible to run.
156
+
-**Block**: Indicates that dependent tasks aren't eligible to run.
157
157
158
158
The default setting for the **DependencyAction** property is **Satisfy** for exit code 0, and **Block** for all other exit conditions.
159
159
160
-
The following code snippet sets the **DependencyAction** property for a parent task. If the parent task exits with a pre-processing error, or with the specified error codes, the dependent task is blocked. If the parent task exits with any other non-zero error, the dependent task is eligible to run.
160
+
The following code snippet sets the **DependencyAction** property for a parent task. If the parent task exits with a preprocessing error, or with the specified error codes, the dependent task is blocked. If the parent task exits with any other nonzero error, the dependent task is eligible to run.
0 commit comments