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

Fix async handle leak when sync RandomAccess read/write on async handle fails #69956

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

stephentoub
Copy link
Member

Contributes to #69377

This isn't invoking user code and it's entirely for synchronous operations; there's no reason it needs to capture ExecutionContext.
@ghost
Copy link

ghost commented May 29, 2022

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

Issue Details

Contributes to #69377

Author: stephentoub
Assignees: -
Labels:

area-System.IO

Milestone: 7.0.0

@stephentoub
Copy link
Member Author

@jeffhandley, is there someone who can help review this?

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

The changes look fairly mechanical and make sense to me. The only real change is the two else paths with the release call and explanation

I don't have enough context on the overall code to say if they are correct however.

@stephentoub
Copy link
Member Author

/backport to release/6.0

@stephentoub stephentoub merged commit 57c88e9 into dotnet:main Jun 10, 2022
@stephentoub stephentoub deleted the fixrandomaccesssyncleak branch June 10, 2022 14:17
@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2475554499

@github-actions
Copy link
Contributor

@stephentoub backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix async handle leak when sync RandomAccess read/write on async handle fails
Using index info to reconstruct a base tree...
M	src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
CONFLICT (content): Merge conflict in src/libraries/System.Private.CoreLib/src/System/IO/RandomAccess.Windows.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix async handle leak when sync RandomAccess read/write on async handle fails
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

stephentoub added a commit to stephentoub/runtime that referenced this pull request Jun 10, 2022
…le fails (dotnet#69956)

* Fix async handle leak when sync RandomAccess read/write on async handle fails

* Use UnsafeAllocateNativeOverlapped in GetNativeOverlappedForAsyncHandle

This isn't invoking user code and it's entirely for synchronous operations; there's no reason it needs to capture ExecutionContext.
danmoseley pushed a commit that referenced this pull request Jun 14, 2022
…le fails (#69956) (#70591)

* Fix async handle leak when sync RandomAccess read/write on async handle fails

* Use UnsafeAllocateNativeOverlapped in GetNativeOverlappedForAsyncHandle

This isn't invoking user code and it's entirely for synchronous operations; there's no reason it needs to capture ExecutionContext.
@ghost ghost locked as resolved and limited conversation to collaborators Jul 10, 2022
Sign up for free to 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.

2 participants