The feature flag EnableEnhancedScopes
changes how dependency injection scopes are resolved from within the JobHost. This was added to prevent any major breaking change, but it has fixed a number of dependency scoping problems for users without any known issues.
Without this flag, scopes are passed via an AsyncLocal which can be problematic in some scenarios (most notably when using HttpClient).
This was introduced here: Azure/azure-functions-host#6721
MotivationWe consider the new scope resolution behavior to be the correct behavior, but were trying to mitigate risk by hiding it behind a feature flag. We should use the new behavior going forward.
ImpactThis will impact all customers as dependency resolution is used everywhere. It's a bigger impact to .NET in-proc customers, but we believe the behavior with the flag is the correct behavior.
Compat-mode supportWe can introduce a DisableEnhancedScopes
flag that puts things back the way they were in v3.
There's no real alternatives that don't involve changes to service resolution. There was a long investigation that led to this flag and behavior being added.
DetectionNot really. Before this flag, a number of odd ObjectDisposedExceptions and null-refs would be seen. Only when we got a number of issues around HttpClient usage did we start diving into the issue we were seeing.
SupportThis isn't a change that most customers will notice, and we don't believe anyone is depending on the previous behavior.
DocumentationNone
Components impactedThis only involves a change to the host.
PerformanceNo performance impact.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4