Skip to content

Commit e5325b3

Browse files
Merge pull request #311028 from xinlaoda/xxin-doc-update-task-event
Xxin doc update task event
2 parents bab6d7e + a2afa4b commit e5325b3

2 files changed

Lines changed: 52 additions & 16 deletions

File tree

articles/batch/batch-task-complete-event.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Batch task complete event
33
description: Reference for Batch task complete event. This event is emitted once a task is completed, regardless of the exit code.
44
ms.topic: reference
5-
ms.date: 07/01/2025
5+
ms.date: 02/05/2026
66
# Customer intent: "As a cloud developer, I want to receive task completion events, so that I can monitor task durations, retry counts, and execution details for better performance analysis and troubleshooting."
77
---
88

@@ -35,7 +35,14 @@ ms.date: 07/01/2025
3535
"endTime": "2016-09-08T16:34:00.666Z",
3636
"exitCode": 0,
3737
"retryCount": 0,
38-
"requeueCount": 0
38+
"requeueCount": 0,
39+
"result": "Success",
40+
"schedulingError": {
41+
"category": "",
42+
"code": "",
43+
"message": "",
44+
"details": []
45+
}
3946
}
4047
}
4148
```
@@ -44,7 +51,7 @@ ms.date: 07/01/2025
4451
|------------------|----------|-----------|
4552
|`jobId`|String|The ID of the job containing the task.|
4653
|`id`|String|The ID of the task.|
47-
|`taskType`|String|The type of the task. This can either be 'JobManager' indicating it's a job manager task or 'User' indicating it isn't a job manager task. Note that this event isn't emitted for job preparation tasks, job release tasks, or start tasks.|
54+
|`taskType`|String|The type of the task. The task type can either be 'JobManager' indicating it's a job manager task or 'User' indicating it isn't a job manager task. This event isn't emitted for job preparation tasks, job release tasks, or start tasks.|
4855
|`systemTaskVersion`|Int32|The internal retry counter on a task. Internally the Batch service can retry a task to account for transient issues. These issues can include internal scheduling errors or attempts to recover from compute nodes in a bad state.|
4956
|`requiredSlots`|Int32|The required slots to run the task.|
5057
|[`nodeInfo`](#nodeInfo)|Complex Type|Contains information about the compute node on which the task ran.|
@@ -69,14 +76,25 @@ ms.date: 07/01/2025
6976

7077
|Element name|Type|Notes|
7178
|------------------|----------|-----------|
72-
|`maxTaskRetryCount`|Int32|The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.<br /><br /> This value specifically controls the number of retries. The Batch service tries the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries).<br /><br /> If the maximum retry count is 0, the Batch service doesn't retry tasks.<br /><br /> If the maximum retry count is -1, the Batch service retries tasks without limit.<br /><br /> The default value is 0 (no retries).|
79+
|`maxTaskRetryCount`|Int32|The maximum number of times the task might be retried. The Batch service retries a task if its exit code is nonzero.<br /><br /> This value specifically controls the number of retries. The Batch service tries the task once, and might then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to four times (one initial try and three retries).<br /><br /> If the maximum retry count is 0, the Batch service doesn't retry tasks.<br /><br /> If the maximum retry count is -1, the Batch service retries tasks without limit.<br /><br /> The default value is 0 (no retries).|
7380

7481
### <a name="executionInfo"></a> executionInfo
7582

7683
|Element name|Type|Notes|
7784
|------------------|----------|-----------|
78-
|`startTime`|DateTime|The time when the task started running. 'Running' corresponds to the **running** state, so if the task specifies resource files or application packages, then the start time reflects the time when the task started downloading or deploying these. If the task restarted or retried, this is the most recent time at which the task started running.|
85+
|`startTime`|DateTime|The time when the task started running. 'Running' corresponds to the **running** state, so if the task specifies resource files or application packages, then the start time reflects the time when the task started downloading or deploying these resource files or application packages. If the task restarted or retried, this is the most recent time at which the task started running.|
7986
|`endTime`|DateTime|The time when the task completed.|
80-
|`exitCode`|Int32|The exit code of the task.|
81-
|`retryCount`|Int32|The number of times the task is retried by the Batch service. The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.|
82-
|`requeueCount`|Int32|The number of times the task is requeued by the Batch service as the result of a user request.<br /><br /> When you remove nodes from a pool (by resizing or shrinking it) or disable a job, you can choose to requeue the running tasks on those nodes for execution. This count tracks how many times the task requeued for these reasons.|
87+
|`exitCode`|Int32|The exit code of the task. If the task failed before it started running, then exitCode is null.|
88+
|`retryCount`|Int32|The number of times the Batch service retried the task. The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.|
89+
|`requeueCount`|Int32|The number of times the Batch service requeued the task as the result of a user request.<br /><br /> When nodes are removed from a pool (through resizing or shrinking) or a job is disabled, you can choose to requeue the running tasks on those nodes. This count tracks how many times a task was requeued for these reasons.|
90+
|`result`|String|The task result string, it could be "Success" or "Failure"|
91+
|[`schedulingError`](#schedulingError)|Complex Type|Contains detailed information about the error.|
92+
93+
### <a name="schedulingError"></a> schedulingError
94+
95+
|Element name|Type|Notes|
96+
|------------------|----------|-----------|
97+
|`category`|String|The error category, for example "UserError".|
98+
|`code`|String|The error code, for example "FailureExitCode".|
99+
|`message`|String|The error message.|
100+
|`details`|Array|The error details.|

articles/batch/batch-task-fail-event.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Batch task fail event
33
description: Reference for Batch task fail event. This event is emitted in addition to a task complete event and can be used to detect when a task fails.
44
ms.topic: reference
5-
ms.date: 07/01/2025
5+
ms.date: 02/05/2026
66
# Customer intent: As a cloud operations engineer, I want to receive notifications for task failure events, so that I can quickly identify issues and take corrective actions to ensure job reliability and efficiency.
77
---
88

@@ -35,7 +35,14 @@ ms.date: 07/01/2025
3535
"endTime": "2016-09-08T16:34:00.666Z",
3636
"exitCode": 1,
3737
"retryCount": 2,
38-
"requeueCount": 0
38+
"requeueCount": 0,
39+
"result": "Failure",
40+
"schedulingError": {
41+
"category": "UserError",
42+
"code": "FailureExitCode",
43+
"message": "The task exited with an exit code representing a failure",
44+
"details": []
45+
}
3946
}
4047
}
4148
```
@@ -44,11 +51,11 @@ ms.date: 07/01/2025
4451
|------------------|----------|-----------|
4552
|`jobId`|String|The ID of the job containing the task.|
4653
|`id`|String|The ID of the task.|
47-
|`taskType`|String|The type of the task. It's either 'JobManager' indicating it's a job manager task or 'User' indicating it's not a job manager task. It's not emitted for job preparation tasks, job release tasks, or start tasks.|
54+
|`taskType`|String|The type of the task. It's either 'JobManager' indicating it's a job manager task or 'User' indicating it's not a job manager task. This event isn't emitted for job preparation tasks, job release tasks, or start tasks.|
4855
|`systemTaskVersion`|Int32|It's the internal retry counter on a task. Internally the Batch service can retry a task to account for transient issues. These issues can include internal scheduling errors or attempts to recover from compute nodes in a bad state.|
4956
|`requiredSlots`|Int32|The required slots to run the task.|
5057
|[`nodeInfo`](#nodeInfo)|Complex Type|Contains information about the compute node on which the task ran.|
51-
|[`multiInstanceSettings`](#multiInstanceSettings)|Complex Type|Specifies that the task is a Multi-Instance Task requiring multiple compute nodes. See [`multiInstanceSettings`](/rest/api/batchservice/get-information-about-a-task) for details.|
58+
|[`multiInstanceSettings`](#multiInstanceSettings)|Complex Type|Specifies that the task is a Multi-Instance Task requiring multiple compute nodes. See [`multiInstanceSettings`](/rest/api/batchservice/get-information-about-a-task) for details.|
5259
|[`constraints`](#constraints)|Complex Type|The execution constraints that apply to this task.|
5360
|[`executionInfo`](#executionInfo)|Complex Type|Contains information about the execution of the task.|
5461

@@ -69,7 +76,7 @@ ms.date: 07/01/2025
6976

7077
|Element name|Type|Notes|
7178
|------------------|----------|-----------|
72-
|`maxTaskRetryCount`|Int32|The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.<br /><br /> This value specifically controls the number of retries. The Batch service tries the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to 4 times (one initial try and 3 retries).<br /><br /> If the maximum retry count is 0, the Batch service doesn't retry tasks.<br /><br /> If the maximum retry count is -1, the Batch service retries tasks without limit.<br /><br /> The default value is 0 (no retries).|
79+
|`maxTaskRetryCount`|Int32|The maximum number of times the task might be retried. The Batch service retries a task if its exit code is nonzero.<br /><br /> This value specifically controls the number of retries. The Batch service tries the task once, and might then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a task up to four times (one initial try and three retries).<br /><br /> If the maximum retry count is 0, the Batch service doesn't retry tasks.<br /><br /> If the maximum retry count is -1, the Batch service retries tasks without limit.<br /><br /> The default value is 0 (no retries).|
7380

7481

7582
### <a name="executionInfo"></a> executionInfo
@@ -78,6 +85,17 @@ ms.date: 07/01/2025
7885
|------------------|----------|-----------|
7986
|`startTime`|DateTime|The time when the task started running. 'Running' corresponds to the **running** state, so if the task specifies resource files or application packages, then the start time reflects the time at which the task started downloading or deploying them. If the task is restarted or retried, it's the most recent time at which the task started running.|
8087
|`endTime`|DateTime|The time when the task completed.|
81-
|`exitCode`|Int32|The exit code of the task.|
82-
|`retryCount`|Int32|The number of times the task is retried by the Batch service. The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.|
83-
|`requeueCount`|Int32|The number of times the task is requeued by the Batch service as a result of user request.<br /><br /> When users remove nodes from a pool (by resizing or shrinking it) or disable a job, they can choose to requeue the running tasks on those nodes for execution. This count tracks how many times the task is requeued for these reasons.|
88+
|`exitCode`|Int32|The exit code of the task. If the task failed before it started running, then exitCode is null.|
89+
|`retryCount`|Int32|The number of times the Batch service retried the task. The task is retried if it exits with a nonzero exit code, up to the specified MaxTaskRetryCount.|
90+
|`requeueCount`|Int32|The number of times the Batch service requeued the task as a result of user request.<br /><br /> When nodes are removed from a pool (through resizing or shrinking) or a job is disabled, you can choose to requeue the running tasks on those nodes. This count tracks how many times a task was requeued for these reasons.|
91+
|`result`|String|The task result string, it could be "Success" or "Failure".|
92+
|[`schedulingError`](#schedulingError)|Complex Type|Contains detailed information about the error.|
93+
94+
### <a name="schedulingError"></a> schedulingError
95+
96+
|Element name|Type|Notes|
97+
|------------------|----------|-----------|
98+
|`category`|String|The error category, for example "UserError".|
99+
|`code`|String|The error code, for example "FailureExitCode".|
100+
|`message`|String|The error message.|
101+
|`details`|Array|The error details.|

0 commit comments

Comments
 (0)