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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容