You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select Diagnose and solve problems from the left, and view relevant dashboards before opening your issue.
Investigative information
Please provide the following:
Timestamp: 2023-11-08T08:28:49.6365789Z
Function App version: 4.27.5.5
Function App name: dev-retriever-engine
Function name(s) (as appropriate): function_scraper
Invoke a function till the cancellation of the worker due to a timeout. The worker process will be killed and a new one will be created to have always 8 workers.
Make some new invocations, they will be processed only by the new worker. Other workers will never be used.
Expected behavior
The other workers should also be triggered after the kill of a worker due to a cancellation of a function invocation.
I've done 16 invocations of the function.
We can see in the following image that the invocations are evenly distributed among the workers.
traces
| where timestamp > ago(1d)
| where message startswith "Transaction triggered by Service Bus"
| where customDimensions["HostInstanceId"]=="299608c0-0e68-40fd-9a82-abb1168801eb"
| order by timestamp desc
| project timestamp, instanceId=customDimensions["HostInstanceId"], workerId=substring(substring(message, indexof(message, "worker_id")+13), 0, 36), invocationId=customDimensions["InvocationId"], message
Then, I've done an invocation (3c010a34-42df-4393-b0ff-bfa0d1403843) of the function that has lasted till the cancellation by Azure.
It was executed by the worker 039fd8f5-b5a5-4951-8148-7dc2f1748ca8.
When the function invocation is cancelled, the process of the worker is killed, and a new worker process (39f9623f-8cc1-4980-a802-ae1e43a20f3d) is created:
The Service Bus event is triggered again (Invocation Id: 3721f1aa-926c-4a46-9536-9850ed8687d9).
The function invocation is processed by the new worker 39f9623f-8cc1-4980-a802-ae1e43a20f3d.
Then the function invocation is cancelled again by Azure due to a timeout. The process worker is killed and a new worker process (69c25cae-78b6-4ac5-9147-a888428d01a4) is created.
Then, I've done 8 new invocations, and we can see that these invocations have been processed by only one worker (69c25cae-78b6-4ac5-9147-a888428d01a4).
The invocations are not evenly distributed among the worker anymore.
Previously, we'd remove all channels for a language during a restart (note the TryRemove()). But we wouldn't kill them all -- they'd just be unable to be invoked as they wouldn't be in our channel list anymore. Now we'll do a TryGet() in order to restart only a single worker.
Check for a solution in the Azure portal
For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select
Diagnose and solve problems
from the left, and view relevant dashboards before opening your issue.Investigative information
Please provide the following:
Repro steps
Expected behavior
The other workers should also be triggered after the kill of a worker due to a cancellation of a function invocation.
Actual behavior
I've ssh-ed to a new fresh instance and did a ps:
We have 8 azure_functions_worker processes.
I've done 16 invocations of the function.
We can see in the following image that the invocations are evenly distributed among the workers.
Then, I've done an invocation (3c010a34-42df-4393-b0ff-bfa0d1403843) of the function that has lasted till the cancellation by Azure.
It was executed by the worker 039fd8f5-b5a5-4951-8148-7dc2f1748ca8.
When the function invocation is cancelled, the process of the worker is killed, and a new worker process (39f9623f-8cc1-4980-a802-ae1e43a20f3d) is created:
The Service Bus event is triggered again (Invocation Id: 3721f1aa-926c-4a46-9536-9850ed8687d9).
The function invocation is processed by the new worker 39f9623f-8cc1-4980-a802-ae1e43a20f3d.
Then the function invocation is cancelled again by Azure due to a timeout. The process worker is killed and a new worker process (69c25cae-78b6-4ac5-9147-a888428d01a4) is created.
Then, I've done 8 new invocations, and we can see that these invocations have been processed by only one worker (69c25cae-78b6-4ac5-9147-a888428d01a4).
The invocations are not evenly distributed among the worker anymore.
Known workarounds
None
Related information
Provide any related information
host.json
Source
The text was updated successfully, but these errors were encountered: