Uh oh!
There was an error while loading. Please reload this page.
Fix leak caused by not disposing the scoped parent service provider - #74261
Conversation
ghost
commented
Aug 19, 2022
Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection Issue DetailsFixes #73832
|
tarekgh
commented
Aug 19, 2022
CC @ericstj |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // If this ServiceProviderEngineScope instance is a root scope, disposing this instance will need to dispose the RootProvider too. | ||
| // Otherwise the RootProvider will never get disposed and will leak. | ||
| // Note, if the RootProvider get disposed first, it will automatically dispose all attached ServiceProviderEngineScope objects. | ||
| RootProvider.Dispose(); |
There was a problem hiding this comment.
Why cant this just noop internally?
There was a problem hiding this comment.
It is simpler. no?
More code, more bugs :-) imagine in the future we add anything to the ServicePrivder dispose method.
There was a problem hiding this comment.
Why cant this just noop internally?
By "just noop internally", you mean adding the if check in ServiceProvider Dispose?
tarekgh
commented
Aug 22, 2022
/backport to release/7.0-rc1 |
Started backporting to release/7.0-rc1: https://github.com/dotnet/runtime/actions/runs/2905770618 |
tarekgh
commented
Aug 22, 2022
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2905993688 |
Fixes#73832