Skip to content

[HTTP/3] Disabled cookie tests / retries happen on the same connection #56870

Closed

Description

@ManickaP

Whole SocketsHttpHandlerTest_Cookies_Http3_Mock class is disabled since it fails in CI (doesn't reproduce locally with > 100 runs)
Error:

System.Net.Http.HttpRequestException : An error occurred while sending the request.
---- System.Net.Quic.QuicStreamAbortedException : Stream aborted by peer (267).
   at System.Net.Http.Http3RequestStream.SendAsync(CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs:line 246
   at System.Net.Http.Http3RequestStream.SendAsync(CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs:line 292
   at System.Net.Http.Http3Connection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs:line 213
   at System.Net.Http.HttpConnectionPool.TrySendUsingHttp3Async(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 927
   at System.Net.Http.HttpConnectionPool.DetermineVersionAndSendAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 989
   at System.Net.Http.HttpConnectionPool.SendAndProcessAltSvcAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1019
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 1038
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 81
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken) in /_/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 527
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Cookies.<GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent>b__17_0(Uri url) in /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs:line 318
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 64
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 91
   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 38
--- 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 98
   at System.Net.Http.Functional.Tests.HttpClientHandlerTest_Cookies.GetAsyncWithRedirect_SetCookieContainer_CorrectCookiesSent() in /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Cookies.cs:line 303
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Quic.Implementations.Mock.MockStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/Mock/MockStream.cs:line 76
   at System.Net.Http.Http3RequestStream.ReadFrameEnvelopeAsync(CancellationToken cancellationToken) in /_/src/libraries/System.

Activity

  1. ghost added
    untriaged
    on Aug 4, 2021
  2. removed
    untriaged
    on Aug 4, 2021
  3. added this to the Future milestone on Aug 4, 2021
  4. added
    disabled-test
    test-run-core
    on Aug 4, 2021
  5. ghost added
    in-pr
    on Aug 5, 2021
  6. ghost removed
    in-pr
    on Aug 5, 2021
  7. ManickaP commented on Aug 5, 2021

    @ManickaP
    MemberAuthor

    Description how what the problem is: #56831 (comment)
    Description how the problem manifests: #56831 (comment)

    GoAway arrives on the control stream thus there's a race with the request processing, which might be faster and even make 3 retries on the same connection before it receives and processes GoAway.

  8. changed the title [-][HTTP/3] Disabled cookie tests on mock[/-] [+][HTTP/3] Disabled cookie tests on mock / retries happen on the same connection[/+] on Aug 6, 2021
  9. changed the title [-][HTTP/3] Disabled cookie tests on mock / retries happen on the same connection[/-] [+][HTTP/3] Disabled cookie tests / retries happen on the same connection[/+] on Aug 6, 2021
  10. geoffkizer commented on Aug 31, 2021

    @geoffkizer
    Contributor

    I think we could solve the problem here by just not sending H3_REQUEST_REJECTED from the loopback server for new requests. This would eliminate the race between H3_REQUEST_REJECTED and GOAWAY. The GOAWAY itself, once received and processed, should be sufficient to cause new requests to be retried.

    This doesn't address the general problem with HTTP3 here, but it would at least allow us to reliably reenable tests.

  11. ManickaP commented on Sep 19, 2023

    @ManickaP
    MemberAuthor

    We don't have a mock implementation anymore.

  12. modified the milestones: Future, 9.0.0 on Oct 11, 2023
  13. ghost locked as resolved and limited conversation to collaborators on Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.Httpdisabled-testtest-run-core

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions