We have an azure function app which has multiple instances, we noticed an issue where a service bus triggered function app mostly terminated its execution on instance A and restarted on instance B (could come to this conclusion as the deliveryCount of the message was 2 when it started executing on instance B).
When an instance is scaled down does it wait for the running process to complete or does it terminate anyway?
We have an azure function app which has multiple instances, we noticed an issue where a service bus triggered function app mostly terminated its execution on instance A and restarted on instance B (could come to this conclusion as the deliveryCount of the message was 2 when it started executing on instance B).
When an instance is scaled down does it wait for the running process to complete or does it terminate anyway?
Share Improve this question asked Mar 6 at 14:57 Sujay SalinsSujay Salins 153 bronze badges 1- Could you please provide screen shot of error? – Rakesh Govindula Commented Mar 11 at 13:21
1 Answer
Reset to default 0***We have an azure function app which has multiple instances, we noticed an issue where a service bus triggered function app mostly terminated its execution on instance A and restarted on instance B (could come to this conclusion as the delivery Count of the message was 2 when it started executing on instance B).
When an instance is scaled down does it wait for the running process to complete or does it terminate anyway?
**When an instance of a Function App is terminated (for example because of scaling down), any actively running executions (like the one handling a Service Bus message) can be interrupted. However, Azure does not directly wait for these executions to finish before scaling down.
**If an execution is interrupted or the instance is terminated during the execution, Azure will typically restart the function on another available instance. This is because Azure Functions uses a distributed system, and it can pick up uncompleted executions from another instance.
**In your case, the message’s delivery count was 2 when it started on Instance B. This indicates that the execution was interrupted on Instance A (likely due to the instance being scaled down or restarted), causing the message to be reprocessed. The scaling down process likely led to the termination of the function's execution on Instance A, and the Service Bus message was then redelivered to another instance (Instance B) for processing, which increased the delivery count of the message.
**Create a timer trigger function app that checks the queue to see how long the most recent message has been there in case and if the time is longer than what is considered normal then send an alert.
**you can also check the Microsoft documentation that I've attached
[https://learn.microsoft/en-us/azure/azure-functions/functions-scale]
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744967794a4603788.html
评论列表(0条)