Posted On: Dec 22, 2022
AWS Batch now enables you to gain visibility into the current state of a terminated or cancelled job. This means that once you terminate/cancel a job, a flag of isTerminated or isCancelled can be observed in the job payload throughout the queue before it moves to either a ‘Terminated’ or ‘Cancelled’ state.
With this new flag, you can easily track the status of all active jobs that will be run and separate them from the ones that will eventually be Terminated or Cancelled as they move to the head of the queue. This provides greater visibility over the jobs’ status and helps you track them better through their lifecycle.
You can use DescribeJobs API operation to query the up to date job state. When you call this operation, two new fields isCancelled and isTerminated can be observed in the payload. With these fields, you can get the info on whether that job will be Terminated or Cancelled when it reaches the head of the queue.
Now you can query jobs with a finer control on their current status. You no longer need to wait until the job moves to the head of the queue to determine if it will be run or will be Terminated/Cancelled. The two new fields are now available in all AWS Regions where AWS Batch is currently available. To learn more about AWS Batch, see the AWS Batch User Guide. To learn more about the AWS Batch API, see the AWS Batch API Reference.