

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 服务作业队列阻塞事件
<a name="batch-service-job-queue-blocked-events"></a>

每当 AWS Batch 检测到队列被阻塞时，都会在 Amazon Events 中创建一个 CloudWatch 事件。队列阻塞的原因也会在 [https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 操作的 `statusReason` 字段中提供。

**Example 服务作业队列阻塞事件**  
服务作业队列阻塞事件的传输格式如下。该`detail`部分类似于《API *参考*》中从 [DescribeServiceJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html)API 操作返回的AWS Batch 响应。有关 EventBridge参数的更多信息，请参阅 *Amazon EventBridge 用户指南*中的[事件和事件模式](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)。  
`detail` 事件不包含 `tags` 和 `serviceRequestPayload` 字段。

```
{
  "version": "0",
  "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
  "detail-type": "Batch Service Job Queue Blocked",
  "source": "aws.batch",
  "account": "{{123456789012}}",
  "time": "2022-01-11T23:36:40Z",
  "region": "{{us-east-1}}",
  "resources": [
    "arn:aws:batch:{{us-east-1}}:{{123456789012}}:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
  ],
  "detail": {
    "attempts": [],
    "createdAt": 1641944200058,
    "jobArn": "arn:aws:batch:{{us-east-1}}:{{123456789012}}:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
    "jobId": "6271dfdf-d8a7-41b1-a4d2-55a2224f5375",
    "jobName": "event-test",
    "jobQueue": "arn:aws:batch:{{us-east-1}}:{{123456789012}}:job-queue/HappyPathJobQueue",
    "serviceJobType": "SAGEMAKER_TRAINING",
    "status": "RUNNABLE",
    "statusReason": "{{blocked-reason}}",
    "timeoutConfig": {
      "attemptDurationSeconds": 60
    }
  }
}
```