作业队列阻塞事件 - Amazon Batch
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

作业队列阻塞事件

每当 Amazon Batch 检测到作业处于 RUNNABLE 状态从而阻止队列时,都会在 Amazon CloudWatch Events 中创建一个事件。有关支持的队列阻止原因的更多信息,请参阅 作业在RUNNABLE状态卡住。同样的原因也提供在 DescribeJobs API 操作的 statusReason 字段中。

例 作业队列阻塞事件

作业队列阻塞事件的传输格式如下。detail 部分类似于 Amazon BatchAPI Reference 中的 DescribeJobs API 操作返回的 JobDetail 对象。有关 EventBridge 参数更多信息,请参阅 Amazon EventBridge 用户指南事件和事件模式

{ "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": [] } }