We are using Azure functions with consumption plan. It is queue triggered and we process customer workflows in the function code. Recently, we saw that function processing got shut down as one execution exceeded 10 minutes processing time limit.
We have now added code to check for time elapsed at various places and exit if we are approaching the limit. However, there can be some corner cases where time limit is reached.
What is the recommended pattern here to ensure that function worker process exits (forced exit if needed) within the time limit. We cannot afford to reach this state:
Timeout value of 00:10:00 was exceeded by function: XXXXXXXX
A function timeout has occurred. Host is shutting down.
Stopping JobHost
Stopping the listener
Or is there a configuration that will kill the individual process instead of job host itself?