[BUG] GetProcessorCount for webjobs service bus extension does not override processor count for flex consumption #45970
Labels
Client
This issue points to a problem in the data-plane of the library.
Functions
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
Service Attention
Workflow: This issue is responsible by Azure service team.
Library name and version
Microsoft.Azure.WebJobs.Extensions.ServiceBus 5.16.4.0
Describe the bug
Logic that uses the processor count to figure out default value of maxConcurrentCalls needs to special case the flex consumption SKU similar to how it special cases the consumption SKU.
This logic is in the
GetProcessorCount
helper.https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Microsoft.Azure.WebJobs.Extensions.ServiceBus/src/Utility.cs#L14
Here is some relevant code from functions host for detecting flex consumption via environment variables:
https://github.com/Azure/azure-functions-host/blob/f58df65944a2eca87c7ce0e837b2141f4b0a95bf/src/WebJobs.Script/Environment/EnvironmentExtensions.cs#L225
https://github.com/Azure/azure-functions-host/blob/f58df65944a2eca87c7ce0e837b2141f4b0a95bf/src/WebJobs.Script/ScriptConstants.cs#L119
Expected behavior
Flex consumption apps default to using maxConcurrentCalls = 16.
Actual behavior
Flex consumption apps default to using maxConcurrentCalls = 64, because the system thinks the processor count is 4.
Reproduction Steps
Deploy a service bus triggered function on flex consumption and observe the concurrency behavior.
The text was updated successfully, but these errors were encountered: