Closed Bouke closed 7 months ago
Hi
If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano Azure App Service
I have a continuous WebJob that runs on multiple instances. I want to enable automatic scaling on these instances. The instances are running long-running tasks, but the number tasks varies throughout the day. I can come up with an appropriate scaling rule. On scale-in a (seemingly) random instance is picked that will be shutdown, while it might still be doing a long-running task. As per the docs this is a hard shutdown and the instance has 3 minutes to finish up their work:
However based on my testing, the instance is killed within 30 seconds of signalling the graceful shutdown. Not 3 minutes.
As an aside, this is far from ideal: I'd rather be able to specify a graceful shutdown duration of a few hours so that I don't have to restart this work on another instance. I mean there's no hurry in shutting the instance down for Microsoft: I'll still be paying for that instance until it is off.
Repro steps.
Program.cs
settings.job
Expected behaviour
The job keeps running for the full 3 minutes.
Desired behaviour
The job keeps running for
stopping_wait_time
that I specify up to a few hours.Actual behaviour
The job's last output lines show that it didn't even last 30 seconds to get killed:
Project structures.
The log/error given by the failure.
Debug your Azure website remotely.
Mention any other details that might be useful.