J.B
J.B

Reputation: 147

Retrying Tasks in Azure Batch

  1. How does Batch know whether to retry some tasks or not? Does it solely depend on the exit code? If yes, how can I control the exit code?

  2. It seems from some logs that a task in my job got retried but I can't find the output files or information about the exit code in the first failed try. Is there a way to get that information (after the fact)?

  3. When I check my task properties, it says that the maximum task retries is 0, however, some logs show that the task retried. How could that be possible?

Thanks!

Upvotes: 1

Views: 1434

Answers (1)

Tats_innit
Tats_innit

Reputation: 34107

I will attach the source I found this information from as well, Hope this helps: : - )

  • A task is considered to have failed if it completes with a nonzero exit code and has exhausted its retry count, or if it had a scheduling error.[1] so not only exit code bur scheduling errors can cause task to fail.

  • If the task got retried to max and they failed then might be its a failed try hence no outputfiles, you can always share your sample code and we can take a look, also, I think you can always write it to the stderr.txt or stdout.txt file to keep track,(I think any console.wrtieline gets chucked into stdout.txt). Sharing code might help.

  • I am not entirely sure of this, so is this relating to task you have ran from your code under a pool, and the portal is showing wrong information, i.e. the task got retried and portal shows retried 0 times?

[1] - https://learn.microsoft.com/en-us/rest/api/batchservice/add-a-job-to-an-account - info was from "onTaskFailure" Notes column

Thanks,

Upvotes: 1

Related Questions