

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

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

每当 AWS Batch 检测到处于该`RUNNABLE`状态的任务从而阻塞队列时，都会在 Amazon Events 中创建一个 CloudWatch 事件。有关支持的队列阻止原因的更多信息，请参阅 [作业在`RUNNABLE`状态卡住](job_stuck_in_runnable.md)。同样的原因也提供在 [https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html) API 操作的 `statusReason` 字段中。

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

```
{
    "version": "0",
    "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
    "detail-type": "Batch 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:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue"
    ],
    "detail": {
        "jobArn": "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobName": "event-test",
        "jobId": "4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue",
        "status": "RUNNABLE",
        "statusReason": "blocked-reason",
        "attempts": [],
        "createdAt": 1641944200058,
        "retryStrategy": {
            "attempts": 2,
            "evaluateOnExit": []
        },
        "dependsOn": [],
        "jobDefinition": "arn:aws:batch:us-east-1:123456789012:job-definition/first-run-job-definition:1",
        "parameters": {},
        "container": {
            "image": "137112412989.dkr.ecr.us-east-1.amazonaws.com/amazonlinux:latest",
            "command": [
                "sleep",
                "600"
            ],
            "volumes": [],
            "environment": [],
            "mountPoints": [],
            "ulimits": [],
            "networkInterfaces": [],
            "resourceRequirements": [
                {
                    "value": "2",
                    "type": "VCPU"
                }, {
                    "value": "256",
                    "type": "MEMORY"
                }
            ],
            "secrets": []
        },
        "propagateTags": false,
        "platformCapabilities": []
    }
}
```