Skip to content

Commit ef21af5

Browse files
[release/10.0] (http2): Lower WINDOWS_UPDATE received on (half)closed stream to stream abortion (#63885)
* change WINDOWS_UPDATE received on (half)closed stream to stream-level error instead of connection-level error * address PR comments --------- Co-authored-by: Korolev Dmitry <dmkorolev@microsoft.com>
1 parent 390528c commit ef21af5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,12 @@ private Task ProcessWindowUpdateFrameAsync()
11581158
{
11591159
if (stream.RstStreamReceived)
11601160
{
1161-
// Hard abort, do not allow any more frames on this stream.
1162-
throw CreateReceivedFrameStreamAbortedException(stream);
1161+
// WINDOW_UPDATE received after we have already processed an inbound RST_STREAM for this stream.
1162+
// RFC 7540 (Sections 5.1, 6.9) / RFC 9113 do not explicitly define semantics for WINDOW_UPDATE on a
1163+
// stream in the "closed" state due to a reset by client. We surface it as a stream error (STREAM_CLOSED)
1164+
// rather than aborting the entire connection to keep behavior deterministic and consistent with other servers.
1165+
// https://github.com/dotnet/aspnetcore/issues/63726
1166+
throw new Http2StreamErrorException(_incomingFrame.StreamId, CoreStrings.Http2StreamAborted, Http2ErrorCode.STREAM_CLOSED);
11631167
}
11641168

11651169
if (!stream.TryUpdateOutputWindow(_incomingFrame.WindowUpdateSizeIncrement))

src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,7 +3599,6 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditi
35993599
AssertConnectionNoError();
36003600
}
36013601

3602-
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/53744")]
36033602
[Fact]
36043603
public async Task RST_STREAM_IncompleteRequest_AdditionalWindowUpdateFrame_ConnectionAborted()
36053604
{
@@ -3618,10 +3617,12 @@ public async Task RST_STREAM_IncompleteRequest_AdditionalWindowUpdateFrame_Conne
36183617
await SendRstStreamAsync(1);
36193618
await SendWindowUpdateAsync(1, 1024);
36203619

3621-
await WaitForConnectionErrorAsync<Http2ConnectionErrorException>(ignoreNonGoAwayFrames: false, expectedLastStreamId: 1,
3622-
Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.WINDOW_UPDATE, 1));
3620+
await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.STREAM_CLOSED, CoreStrings.Http2StreamAborted);
36233621

36243622
tcs.TrySetResult(); // Don't let the response start until after the abort
3623+
3624+
await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false);
3625+
AssertConnectionNoError();
36253626
}
36263627

36273628
[Fact]

0 commit comments

Comments
 (0)