Skip to content

[HTTP/3] Test failure SendAsync_WithZeroLengthHeaderName_Throws #56292

Closed

Description

@karelz

Failures 5/26-7/27 (incl. PRs):

Day Failures
7/25 2x Official run
7/26 3x Official run + 8x PR
7/27 (incomplete day) 1x Official run + 7x PR

Test type: System.Net.Http.Functional.Tests.SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_MsQuic

Failure:

System.Net.Quic.QuicConnectionAbortedException : Connection aborted by peer (256).

   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.ShutdownCompleted(CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 576
   at System.Net.Test.Common.Http3LoopbackStream.SendResponseBodyAsync(Byte[] content, Boolean isFinal) in /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs:line 274
   at System.Net.Test.Common.Http3LoopbackStream.SendResponseAsync(HttpStatusCode statusCode, IList`1 headers, String content, Boolean isFinal) in /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs:line 235
   at System.Net.Test.Common.Http3LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs:line 195
   at System.Net.Test.Common.Http3LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content) in /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs:line 76
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.<>c.<<SendAsync_WithZeroLengthHeaderName_Throws>b__16_1>d.MoveNext() in /_/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs:line 425
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 63
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 82
   at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass5_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() in /_/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs:line 39
--- End of stack trace from previous location ---
   at System.Net.Test.Common.Http3LoopbackServerFactory.CreateServerAsync(Func`3 funcAsync, Int32 millisecondsTimeout, GenericLoopbackOptions options) in /_/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs:line 101
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.SendAsync_WithZeroLengthHeaderName_Throws() in /_/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs:line 413
--- End of stack trace from previous location ---

Activity

  1. added this to the 6.0.0 milestone on Jul 26, 2021
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jul 26, 2021
  3. added
    test-run-coreTest failures in .NET Core test runs
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 26, 2021
  4. added
    disabled-testThe test is disabled in source code against the issue
    on Jul 27, 2021
  5. wfurt commented on Jul 28, 2021

    @wfurt
    Member

    This is easy to reproduce. The test actually expects failure e.g. IOException.
    The problem is that we throw

          System.Net.Quic.QuicConnectionAbortedException : Connection aborted by peer (256).
    

    My initial reaction was to add it to expected exceptions. But that seems wrong since Quic is not public so there would be no way for users to catch it.

    It seems like the right action would be to catch all Quic exceptions and convert them to either HttpRequest or IOExceptions. Thoughts on this @geoffkizer @stephentoub ?

  6. stephentoub commented on Jul 28, 2021

    @stephentoub
    Member

    so there would be no way for users to catch it

    They can still catch it, just as the base Exception.

    In what situation do these exceptions escape unwrapped to the caller? From HttpClient we typically expect all exceptions to be wrapped in an HttpRequestException, or if coming out of a Stream, in an IOException.

  7. wfurt commented on Jul 28, 2021

    @wfurt
    Member

    Looking at it again, it actually escapes at server side e.g. loopback

            --- End of stack trace from previous location ---
            /home/furt/github/wfurt-runtime/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs(581,0): at System.Net.Quic.Implementations.MsQuic.MsQuicStream.ShutdownCompleted(CancellationToken cancellationToken)
            /home/furt/github/wfurt-runtime/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs(277,0): at System.Net.Test.Common.Http3LoopbackStream.SendResponseBodyAsync(Byte[] content, Boolean isFinal)
            /home/furt/github/wfurt-runtime/src/libraries/Common/tests/System/Net/Http/Http3LoopbackStream.cs(240,0): at System.Net.Test.Common.Http3LoopbackStream.SendResponseAsync(HttpStatusCode statusCode, IList`1 headers, String content, Boolean isFinal)
            /home/furt/github/wfurt-runtime/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs(190,0): at System.Net.Test.Common.Http3LoopbackConnection.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content)
            /home/furt/github/wfurt-runtime/src/libraries/Common/tests/System/Net/Http/Http3LoopbackServer.cs(75,0): at System.Net.Test.Common.Http3LoopbackServer.HandleRequestAsync(HttpStatusCode statusCode, IList`1 headers, String content)
            /home/furt/github/wfurt-runtime/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs(427,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Headers.<>c.<<SendAsync_WithZeroLengthHeaderName_Throws>b__16_1>d.MoveNext()
            --- End of stack trace from previous location ---
    
                   async server =>
                    {
                        // The client may detect the bad header and close the connection before we are done sending the response.
                        // So, eat any IOException that occurs here.
                        try
                        {
                            await server.HandleRequestAsync(headers: new[]
                            {
                                new HttpHeaderData("", "foo")
                            });
                        }
                        catch (IOException) { }
                    });

    So I guess less pressing but what the fix should be? Should Http3 loopback wrap or should we add the alternative Quic exceptions to tests as we see fit?

    I'll keep eyes on the client side. I just go to moving up from Quic to focusing on HTTP tests.

  8. self-assigned this
    on Jul 29, 2021
  9. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 3, 2021
  10. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 5, 2021
  11. ghost locked as resolved and limited conversation to collaborators on Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions