Skip to content

[release/9.0-staging] Fix PipeStream leak on Windows when pipe is disposed with a pending operation #116188

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

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 1, 2025

Backport of #115453 to release/9.0-staging

/cc @stephentoub

Customer Impact

  • Customer reported
  • Found internally

A small leak of native handles occurs when a PipeStream is disposed of while an asynchronous read or write is pending on the stream. A customer noticed this in the context of using HttpClient with pipes as the transport, such that after long periods of uptime and with connections that would idle out after long periods of time, their memory usage would slowly increase.

Regression

  • Yes
  • No

.NET 6

Testing

Manually validated, in addition to normal testing. Also found a couple of additional places the same pattern occurred and fix those locations.

Risk

Low. The fix is localized to disposing of a resource in a situation it wasn't being cleaned up.

@stephentoub stephentoub added this to the 9.0.x milestone Jun 2, 2025
@stephentoub stephentoub added Servicing-consider Issue for next servicing release review area-System.IO labels Jun 2, 2025
Copy link
Contributor

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

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephentoub
Copy link
Member

cc: @jeffhandley, @artl93

@rbhanda rbhanda modified the milestones: 9.0.x, 9.0.7 Jun 3, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 3, 2025
@stephentoub
Copy link
Member

/ba-g infra failure "Failed to list devices"

@stephentoub stephentoub merged commit 287bff1 into release/9.0-staging Jun 4, 2025
149 of 155 checks passed
@stephentoub stephentoub deleted the backport/pr-115453-to-release/9.0-staging branch June 4, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.IO Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants