-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cancellation Tokens are being emitted for Queue trigger functions when entering Drain Mode #47427
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
FYI this has already been addressed for other triggers, like Service Bus, Timer and others, hoping we could address it in a timely manner for queue storage as well. |
I believe we see the same root cause here: Azure/azure-functions-dotnet-worker#2900 |
Internal incident: IcM 579547346. I believe the issue was introduced by PR 40792. The It is also worth noting that currently, while stopping the listener, the execution |
Looking into the issue. |
This issue was fixed by #47791, and will be included in our next release in February. |
Library name and version
Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues
Describe the bug
When function apps scale in on the Consumption, Flex consumption, and Elastic Premium plans, a drain mode request is sent to the host and extensions. Entering drain mode should not emit a cancellation token to executing functions, it should just stop the listeners so no new function executions happen on that instance. See this issue for a little more details: Azure/azure-webjobs-sdk#2795
It appears like the Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues extension is emitting a cancellation token when drain mode is called, and this should not happen.
Requesting prioritizing fixing this as it has been addressed by other triggers. This is affecting customers on Flex Consumption as it is more aggressive to scale in, blocking some from going to production. Let me know if any more info is needed.
Expected behavior
Function app scale in gracefully and no cancellation token is emitted due to an instance being marked for scale in (drain mode).
Actual behavior
A cancellation token is being emitted when a function app instance gets marked for scale in (drain mode), causing function executions to be cancelled way earlier than they should.
Reproduction Steps
As a repro:
A simple function with a delay of 20 seconds, this is the only function in the app:
It has a 20 second delay in it. The app is deployed to a Flex Consumption azure functions hosting plan. It seems like drain mode is triggering the cancellation token (see in the logs that the token returns true), and this causes the message to appear in the queue again after a few minutes and this repeats again:
Environment
No response
The text was updated successfully, but these errors were encountered: