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?