Skip to content

Fix deadlock in case if pipe reading fails#82326

Merged
jasonmalinowski merged 1 commit intodotnet:mainfrom
jasonmalinowski:fix-deadlock-when-reader-task-fails
Feb 9, 2026
Merged

Fix deadlock in case if pipe reading fails#82326
jasonmalinowski merged 1 commit intodotnet:mainfrom
jasonmalinowski:fix-deadlock-when-reader-task-fails

Conversation

@jasonmalinowski
Copy link
Member

In RemoteCallback.InvokeAsync we have a pipe being used with simultaneous reading and writing. If the reading task fails, it was possible for us to deadlock, since writing to the pipe will then block as the pipe hits it's maximum size. Changing how we wait ensures that if one task fails we'll rethrow the exception rather than deadlock.

Fixes #82323

In RemoteCallback.InvokeAsync we have a pipe being used with
simultaneous reading and writing. If the reading task fails, it was
possible for us to deadlock, since writing to the pipe will then block
as the pipe hits it's maximum size. Changing how we wait ensures that
if one task fails we'll rethrow the exception rather than deadlock.

Fixes dotnet#82323
@jasonmalinowski jasonmalinowski self-assigned this Feb 7, 2026
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner February 7, 2026 01:02
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

Less scary than I thought this would be :-)

@jasonmalinowski jasonmalinowski merged commit b9131b8 into dotnet:main Feb 9, 2026
26 checks passed
@jasonmalinowski jasonmalinowski deleted the fix-deadlock-when-reader-task-fails branch February 9, 2026 20:23
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deadlock in keep-alive session waiting

4 participants