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?

demandé il y a 3 ans585 vues
1 réponse
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.

répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions