-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
The #52484 attempted to fix the race where CallSiteRuntimeResolver.Instance.Resolve and compiled service accessors have a different source of truth for a scoped services promoted to singletons caching location.
The former presumes the value is cached in callSite.Value the latter in ResolvedServices dictionary on the scope.
The problem with the fix is that it only tightened the race for directly resolved services but did nothing for indirectly-resolved ones.
For the following chain:
A(Singleton)->B(Scoped)
When A is resolved B is also resolved and cached into the callSite.Value. When a direct compiled accessor for B is executed on the root scope it would bypass the logic in the fix and would use the ResolvedService collection, skipping callSite.Value entirely.