How to use custom retry code for Batch job

0

I am trying to create conditions for my job to retry. To do this, I have a variable like

EXIT=“exit 25”

in the bash script that my job runs in the docker container, and lines like:

foo || eval $EXIT

Where if the command “foo” fails, the container will exit with code 25. Then, in the job definition, I have a condition for code 25 that tells the job to retry.

However, when this failure occurs, Batch recognizes the code 25 error (and identifies it as the reason for failure) but overrides my “retry” action and kills the job.

I suspect that the command “exit” is telling Batch to kill the job instead of retrying. So my question is: is “exit 25” the correct command to use in Docker to signify failure with code 25, or should I use a different command?

질문됨 3년 전585회 조회
1개 답변
0

Looks like this solution actually works. I didn’t realize Batch creates a new log stream for each attempt, so I didn’t notice that the job was being retried.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠