I have a bunch of webjob queue processing functions:
public static void ProcessSomething( [QueueTrigger("testrequest")] TestThing thing, TextWriter logger, CancellationToken token)
I am confused about the graceful shutdown. That way - when you complete the webjob (or redeploy on it), it allows you to currently process the webjob to start and end - by default, your queue handler has 5 seconds to complete. You can pass a CancellationToken to a method to check for a cancellation request if it is likely that your website will take longer, as described in the "Graceful Completion" section of this article .
Ok, but what is strange is that I found that when the queue handler is started during shutdown, the token has the value IsCancellationRequested , but even if the function ends inside, say, a second, then this queue element is marked as "Never Finished", and after 10 minutes (after the lease expiration for this queue) he returns to the queue.
Is it for design? Can I change this behavior? If, for example, your queue handler sent an email and he shot during shutdown, then he will send an email and then be flagged as never ending, and then send the email again after 10 minutes.
Help!
azure azure-webjobs
Matt roberts
source share