Open nzthiago opened 3 years ago
Potentially related to https://github.com/Azure/azure-webjobs-sdk/issues/2776
@soninaren , what nuget version is this in?
@soninaren , what nuget version is this in?
Should be version 3.0.33
. I don't think it has been released yet.
@soninaren , this affects us a lot in production with HttpTriggered functions. Is there at least an approximate estimate of when 3.0.33 can be released?
@lecamarade are you using the webjobs sdk or a function app. I think the function release is already in progress.
@soninaren , we use a function app. If release is in progress, are we talking, days, weeks or months?
@soninaren , we use a function app. If release is in progress, are we talking, days, weeks or months?
Based on the current release progress it looks like it should be complete in a couple of weeks.
Reactivating this because we're seeing inconsistent behavior across various extensions when drain is initiated. For example, the latest versions of both the Azure Queues and ServiceBus extensions trigger the cancellation token when drain is started.
i've been using azure functions for going on 4 years and drain mode is still a mystery to me. I had incorrectly assumed that it WOULD send cancellation tokens and got really confused when it did for some extensions and not for others. Seems like some docs around drain mode are missing in the az function space and it should be encouraged for extensions to document their expected drain mode behaviour
the recent "fix" in event hub extension pointed out IDrainModeManager which i had never come across in the Az functions docs.
limited results from google on this, some appear to be completely wrong like https://learn.microsoft.com/en-us/answers/questions/770912/why-do-i-see-drainmode-mode-enabled-in-the-logs-an?source=docs
At this time, it sends a request to the Admin API to enter drain mode. Then all currently executing Functions on that instance receive a cancellation token which the customer can handle.
emphasis added.
and https://datanrg.blogspot.com/2021/06/azure-function-drain-mode.html
When the host is put in drain mode, It should: Stop listening for new incoming requests, Cancellation token is passed as a parameter to the function invocation, Finally, a scale-in operation is performed.
@drdamour IDrainModeManager
is for internal use and is not intended for customers to use in their applications so you will not hear about this in the docs anywhere.
The intended behaviour for drain mode is:
I think there was some miscommunication on the intended behaviour which is why some extensions send a cancellation token and some don't, this is something that is actively being fix across the board.
@liliankasem um.... then why is it being advertised for use in recent release notes?
🤷♀️ news to me
well...if it works as advertised it certainly fulfills a need i as an app developer have, though more in the durable functions space of knowing when my instance has entered drain mode.
Customers don't expect a shut down Cancellation Token (related: #2782) when the host enters drain mode.
To ensure currently executing .NET in process functions are allowed to complete successfully we should not signal a host shutdown cancellation token when entering drain mode.
Also as part of the Drain Mode End to End Tests we should have one or more end to end tests that has:
Tasks