Skip to content

Commit 8bf8030

Browse files
authored
HTTP/3 GET Aborted stress scenario fix (#55582)
This adds checks for HTTP/3 specific exceptions to GET Aborted scenario
1 parent 21a7632 commit 8bf8030

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/libraries/System.Net.Http/tests/StressTests/HttpStress/ClientOperations.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,32 @@ public static (string name, Func<RequestContext, Task> operation)[] Operations =
318318
}
319319
}
320320

321+
if (ctx.HttpVersion == HttpVersion.Version30)
322+
{
323+
// HTTP/3 exception nesting:
324+
// HttpRequestException->IOException->HttpRequestException->QuicStreamAbortedException
325+
// HttpRequestException->QuicStreamAbortedException
326+
327+
if (e is IOException && e.InnerException is HttpRequestException)
328+
{
329+
e = e.InnerException;
330+
}
331+
332+
if (e is HttpRequestException)
333+
{
334+
string? name = e.InnerException?.GetType().Name;
335+
switch (name)
336+
{
337+
case "QuicStreamAbortedException":
338+
if (e.InnerException?.Message?.Equals("Stream aborted by peer (258).") ?? false) // 258 = H3_INTERNAL_ERROR (0x102)
339+
{
340+
return;
341+
}
342+
break;
343+
}
344+
}
345+
}
346+
321347
throw;
322348
}
323349
}),

0 commit comments

Comments
 (0)