I need assistance with canceling a job stuck in runnable status on AWS Batch using the JavaScript SDK. Which API option should I choose?
1. The TerminateJobCommand documentation states that it terminates jobs in the STARTING or RUNNING state, causing them to transition to FAILED. Jobs not yet in the STARTING state are canceled as well. Since RUNNABLE status comes before STARTING, would TerminateJobCommand be the right choice?
2. The documentation for CancelJobCommand mentions that a job in RUNNABLE remains there until it reaches the front of the queue, at which point its status changes to FAILED. Does this mean CancelJobCommand could also handle cancellations, albeit with some delay?
My testing experience includes using both CancelJobCommand and TerminateJobCommand on the same runnable job, resulting in a 200 status response each time. However, occasionally, when checking with "aws batch list-jobs --job-status RUNNABLE --region XXXX" to confirm if the target jobs were successfully removed from the RUNNABLE list (i.e., canceled), they still appeared in the list as RUNNABLE even after hours.