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?

feita há 3 anos586 visualizações
1 Resposta
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.

respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas