Reputation: 5520
I had developed a time triggered Azure Web Job and published into Azure with Triggered type. Everything working fine but sometimes the web job goes into shutdown state without logging any exception information in web job dashboard logs and kudu logs.
Before posting question here, I read this blog about Graceful Shutdown.
So, can anyone suggest me how to resolve the above issue.
Upvotes: 2
Views: 808
Reputation: 1
For our case, Besides set the website to always on, and also set WEBJOBS_IDLE_TIMEOUT and SCM_COMMAND_IDLE_TIMEOUT. It turns out we also need to deploy the website to the slot to make it work. We used to use a dedicated slot (without website deployed) to run the webjob and that doesn't work as expected, and webjob will become aborted after about 50 minutes without any error logs.
This may be very obvious so didn't see it mentioned in other places. Hope this can help people with similar situation.
Upvotes: 0
Reputation: 141
In our case triggered webjob has been aborted from time to time. It's occurred Azure aborts triggered webjobs just because it works too long. By default timeout is 2 hours. To increase the timeout in 2 times or what you need it's necessary to add in settings.job the following.
{
"timeout": "04:00:00"
}
Upvotes: 0
Reputation: 20067
For Continuous jobs, there is a default period of 5 seconds waiting for the job process to shutdown before getting killed.
For Triggered jobs, when a shutdown request is detected there is a 30 seconds default waiting period for the job process to stop.
You can change the grace period of a job by specifying it (in seconds) in the settings.job file where the name of the setting is stopping_wait_time
like so:
{ "stopping_wait_time": 60 }
Here is a similar issue you could refer to.
Upvotes: 1