Skip to content

[release/7.0-rc1] Fix leak caused by not disposing the scoped parent service provider - #74362

Merged
carlossanlop merged 2 commits into
release/7.0-rc1from
backport/pr-74261-to-release/7.0-rc1
Aug 22, 2022
Merged

[release/7.0-rc1] Fix leak caused by not disposing the scoped parent service provider#74362
carlossanlop merged 2 commits into
release/7.0-rc1from
backport/pr-74261-to-release/7.0-rc1

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Aug 22, 2022

Copy link
Copy Markdown
Contributor

Backport of #74261 to release/7.0-rc1

/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.

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #74261 to release/7.0-rc1

/cc @tarekgh

Customer Impact

Testing

Risk

IMPORTANT: 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.

Author:github-actions[bot]
Assignees:-
Labels:

area-Extensions-DependencyInjection

Milestone:-

@tarekghtarekgh added this to the 7.0.0 milestone Aug 22, 2022
@tarekghtarekgh self-assigned this Aug 22, 2022
@tarekgh
tarekgh requested a review from eerhardtAugust 22, 2022 17:49
@tarekgh

Copy link
Copy Markdown
Member

CC @davidfowl

@danmoseley

Copy link
Copy Markdown
Contributor

Approved, reliability, customer reported, likely servicing candidate

@carlossanlop

Copy link
Copy Markdown
Contributor

CI failure is a timeout.
Approved and signed off.
Ready to merge. :shipit:

@carlossanlop
carlossanlop merged commit d8e8436 into release/7.0-rc1Aug 22, 2022
@carlossanlop
carlossanlop deleted the backport/pr-74261-to-release/7.0-rc1 branch August 22, 2022 20:25
@ghostghost locked as resolved and limited conversation to collaborators Sep 22, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@tarekgh@danmoseley@carlossanlop@davidfowl@eerhardt