1
votes

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.

1
Did you enable the Always On in the Configuration of your web app?Joy Wang
Yes @JoyWang, I am using premium app service plan.Pradeep
Also, Added the idle time out parameter in the web app>application settings> for one hour by following this link stackoverflow.com/questions/26596968/…Pradeep
what is the frequency of web job set to run? (in minutes)?Sunny Sharma
Add an entry for WEBJOBS_IDLE_TIMEOUT (not SCM_COMMAND_IDLE_TIMEOUT). This is the time, in seconds, until Kudu will kill a WebJob that hasn't had any requests or output in the given time period. It only applies to triggered WebJobs.George Chen

1 Answers

1
votes

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.