Skip to content
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

[release/8.0] Ensure Parallel.ForAsync unregisters from CancellationToken #93674

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 18, 2023

Backport of #93672 to release/8.0

/cc @stephentoub

Customer Impact

An infinite memory leak as long as the developer is reusing the same CancellationTokenSource. If they drop the CTS, then all the state it was keeping alive also goes away.

Testing

All existing tests continue to pass. It’s challenging to write a unit test for this specific functionality and fix, as the storage for this information isn’t observable via public surface area. However, it was validated using a derivation of the original supplied repo. Before the fix, memory usage keeps going up and up; after the fix, it remains steady.

Risk

Minimal risk, this only adds a call to Dispose at the right location.

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

@ghost
Copy link

ghost commented Oct 18, 2023

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #93672 to release/8.0

/cc @stephentoub

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

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

area-System.Threading

Milestone: -

@stephentoub stephentoub added the Servicing-consider Issue for next servicing release review label Oct 18, 2023
@carlossanlop carlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 18, 2023
@carlossanlop
Copy link
Member

Approved by Tactics via email. Ready to merge.

@carlossanlop carlossanlop merged commit eff79a5 into release/8.0 Oct 18, 2023
109 of 112 checks passed
@carlossanlop carlossanlop deleted the backport/pr-93672-to-release/8.0 branch October 18, 2023 18:20
@ghost ghost locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Threading Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants