Skip to content

[QUIC] Throw on write after closed writing side#128494

Merged
ManickaP merged 3 commits into
dotnet:mainfrom
ManickaP:quic-write
May 27, 2026
Merged

[QUIC] Throw on write after closed writing side#128494
ManickaP merged 3 commits into
dotnet:mainfrom
ManickaP:quic-write

Conversation

@ManickaP

Copy link
Copy Markdown
Member

Fixes #121619

Copilot AI review requested due to automatic review settings May 22, 2026 16:51
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@ManickaP ManickaP requested a review from a team May 22, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts System.Net.Quic.QuicStream.WriteAsync to throw when callers attempt to write after the stream’s writing side has been gracefully completed, and adds a functional regression test to lock in the behavior. It also includes minor doc-comment grammar fixes and adds a new localized error string.

Changes:

  • Update QuicStream.WriteAsync to throw InvalidOperationException when a previously returned write ValueTask is already completed successfully (intended to represent a closed writing side).
  • Add a new functional test validating WriteAsync throws after CompleteWrites() + WritesClosed.
  • Fix small “is/if” typos in internal task source XML docs and add a new resx string for the new exception message.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs Changes WriteAsync behavior for post-write-closure calls to throw instead of returning a successful completed ValueTask.
src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs Adds regression coverage for writing after the writing side has closed.
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ValueTaskSource.cs Fixes XML doc grammar (“is” → “if”).
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ResettableValueTaskSource.cs Fixes XML doc grammar (“is” → “if”).
src/libraries/System.Net.Quic/src/Resources/Strings.resx Adds a new localized string for the new InvalidOperationException message.

Comment thread src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs Outdated
Comment thread src/libraries/System.Net.Quic/src/Resources/Strings.resx
Comment thread src/libraries/System.Net.Quic/src/System/Net/Quic/QuicStream.cs Outdated
@ManickaP

Copy link
Copy Markdown
Member Author

/ba-g unrelated

@ManickaP ManickaP merged commit d78013e into dotnet:main May 27, 2026
88 of 94 checks passed
@ManickaP ManickaP deleted the quic-write branch May 27, 2026 08:45
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone May 28, 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.

QuicStream writes do not throw after the stream is closed

3 participants