-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/6.0] Fix leak caused by not disposing the scoped parent service provider #74366
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
Conversation
|
Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection Issue DetailsBackport of #74261 to release/6.0 /cc @tarekgh Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
|
CC @davidfowl |
...Microsoft.Extensions.DependencyInjection/src/Microsoft.Extensions.DependencyInjection.csproj
Show resolved
Hide resolved
...Microsoft.Extensions.DependencyInjection/src/Microsoft.Extensions.DependencyInjection.csproj
Show resolved
Hide resolved
...Microsoft.Extensions.DependencyInjection/src/Microsoft.Extensions.DependencyInjection.csproj
Show resolved
Hide resolved
|
approved offline by @SteveMCarroll |
|
Approved, signed off, OOB package authoring changes properly added, and the CI cannot get any greener than this. Ready to merge. |
They were introduced in September in these 3 PRs: - Microsoft.Extensions.DependencyInjection: dotnet#74366 - Microsoft.Extensions.Hosting.WindowsServices: dotnet#74188 - Microsoft.NETCore.Platforms (RIDs): dotnet#74383
* Update branding to 6.0.11 * Reseting OOB package authoring changes. They were introduced in September in these 3 PRs: - Microsoft.Extensions.DependencyInjection: #74366 - Microsoft.Extensions.Hosting.WindowsServices: #74188 - Microsoft.NETCore.Platforms (RIDs): #74383 Co-authored-by: Carlos Sanchez <[email protected]>
Backport of #74261 to release/6.0
/cc @tarekgh
Customer Impact
In Dependency Injection, when retrieving the IServiceProvider service and disposing it, it will not dispose the parent container which causes a memory leak. Users of HubConnection in SignalR already experienced and reported this issue as indicated in the issue #73832
Testing
Have passed all CI and regression tests. And manually confirmed it fixes the memory leak.
Risk
Fairly low risk. The change started to dispose the Service Provider object that is supposed to be disposed. The break here is minimal as no-one supposes to use this disposed object and even users can use this disposed object to create a Singlton service.