Skip to content

CI test failure: Connection handshake was canceled due to the configured timeout #99074

Closed

Description

@jkotas
    System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates [FAIL]
      Assert.Throws() Failure: Exception type was not an exact match
      Expected: typeof(System.Security.Authentication.AuthenticationException)
      Actual:   typeof(System.Net.Quic.QuicException)
      ---- System.Net.Quic.QuicException : Connection handshake was canceled due to the configured timeout of 00:00:10 seconds elapsing.
      -------- System.OperationCanceledException : The operation was canceled.
      Stack Trace:
        /_/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs(390,0): at System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates()
        /_/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs(397,0): at System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates()
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs(294,0): at System.Net.Quic.QuicListener.StartConnectionHandshake(QuicConnection connection, SslClientHelloInfo clientHello)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs(264,0): at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs(372,0): at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs(913,0): at System.Threading.ThreadPoolWorkQueue.Dispatch()
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.NonBrowser.cs(102,0): at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
        --- End of stack trace from previous location ---
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs(186,0): at System.Net.Quic.QuicListener.AcceptConnectionAsync(CancellationToken cancellationToken)
        /_/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs(390,0): at System.Net.Quic.Tests.MsQuicTests.<>c__DisplayClass8_0.<<CertificateCallbackThrowPropagates>b__2>d.MoveNext()
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ValueTaskSource.cs(119,0): at System.Net.Quic.ValueTaskSource.TryComplete(Exception exception)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs(1203,0): at System.Threading.CancellationTokenSource.CallbackNode.ExecuteCallback()
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs(810,0): at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs(696,0): at System.Threading.CancellationTokenSource.NotifyCancellation(Boolean throwOnFirstException)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs(683,0): at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs(331,0): at System.Threading.TimerQueue.FireNextTimers()
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs(913,0): at System.Threading.ThreadPoolWorkQueue.Dispatch()
        /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.NonBrowser.cs(102,0): at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
        --- End of stack trace from previous location ---
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ValueTaskSource.cs(176,0): at System.Net.Quic.ValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
        /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs(241,0): at System.Net.Quic.QuicListener.StartConnectionHandshake(QuicConnection connection, SslClientHelloInfo clientHello)
      Output:
        System.Net.Quic.QuicException: User configured callback failed.
         ---> System.ArithmeticException: foobar
           at System.Net.Quic.Tests.MsQuicTests.<>c__DisplayClass8_0.<CertificateCallbackThrowPropagates>b__1(Object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors) in /_/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs:line 383
           at System.Net.Quic.QuicConnection.SslConnectionOptions.ValidateCertificate(X509Certificate2 certificate, Span`1 certData, Span`1 chainData) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.SslConnectionOptions.cs:line 225
           --- End of inner exception stack trace ---
           at System.Net.Quic.QuicConnection.SslConnectionOptions.ValidateCertificate(X509Certificate2 certificate, Span`1 certData, Span`1 chainData) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.SslConnectionOptions.cs:line 252
           at System.Net.Quic.QuicConnection.SslConnectionOptions.ValidateCertificate(X509Certificate2 certificate, Span`1 certData, Span`1 chainData) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.SslConnectionOptions.cs:line 225
           at System.Net.Quic.QuicConnection.SslConnectionOptions.StartAsyncCertificateValidation(IntPtr certificatePtr, IntPtr chainPtr)
           at System.Net.Quic.ValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/ValueTaskSource.cs:line 176
           at System.Net.Quic.QuicConnection.FinishConnectAsync(QuicClientConnectionOptions options, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs:line 365
           at System.Net.Quic.QuicConnection.<ConnectAsync>g__StartConnectAsync|2_0(QuicClientConnectionOptions options, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs:line 79
           at System.Net.Quic.QuicConnection.<ConnectAsync>g__StartConnectAsync|2_0(QuicClientConnectionOptions options, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs:line 94
           at System.Net.Quic.Tests.MsQuicTests.<>c__DisplayClass8_0.<<CertificateCallbackThrowPropagates>b__3>d.MoveNext() in /_/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs:line 388
        --- End of stack trace from previous location ---
           at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in /_/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 105
MsQuic Counters:
    CONN_CREATED 1577
    CONN_HANDSHAKE_FAIL 25
    CONN_APP_REJECT 8
    CONN_LOAD_REJECT 0

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=583082
Build error leg or test failing: System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates
Pull request: #99033

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.Net.Quic.QuicException : Connection handshake was canceled due to the configured timeout of 00:00:10 seconds elapsing.",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=583082
Error message validated: [System.Net.Quic.QuicException : Connection handshake was canceled due to the configured timeout of 00:00:10 seconds elapsing.]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 2/28/2024 7:50:19 PM UTC

Report

Build Definition Test Pull Request
584197 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99019
584189 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99048
583901 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #97529
583884 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #98908
583812 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #95565
583795 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99094
583790 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99092
583448 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #98117
583418 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99076
583402 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99073
583430 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates
583376 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #98958
583380 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #98958
583295 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99059
583262 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99025
583200 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99024
583183 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99058
583154 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99042
583106 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #96941
583082 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99033
583094 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99053
583054 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99049
583031 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #99051
583028 dotnet/runtime System.Net.Quic.Tests.MsQuicTests.CertificateCallbackThrowPropagates #98986

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
24 24 24

Activity

  1. added
    blocking-clean-ci
    Known Build Error
    on Feb 28, 2024
  2. ghost added
    untriaged
    on Feb 28, 2024
  3. ManickaP commented on Feb 29, 2024

    @ManickaP
    Member

    @rzikm do you think this might be related to your recent change in cert validation?

  4. rzikm commented on Feb 29, 2024

    @rzikm
    Member

    It is possible let me have a look

  5. self-assigned this
    on Feb 29, 2024
  6. rzikm commented on Feb 29, 2024

    @rzikm
    Member

    Investigation notes:
    The failures seem to be concentrated on Alpine images which have MsQuic built from main, according to the commit hash of the libversion, the msquic library version should contain all the necessary changes for the feature to work.

    Still curious why this failure didn't show up on the original PR

  7. ManickaP commented on Feb 29, 2024

    @ManickaP
    Member

    Still curious why this failure didn't show up on the original PR

    It's likely it didn't run on that set up at all. From our perspective, successful run of the test vs didn't run at all is really almost impossible to distinguish.

  8. rzikm commented on Feb 29, 2024

    @rzikm
    Member

    Looks like microsoft/msquic#4145 was not enough, We will have to disable the test for now, as this will take some time to fix.

  9. rzikm commented on Feb 29, 2024

    @rzikm
    Member

    I think I figured out what is happening, and it's more complicated than I thought. According to the traces and packet captures I collected, following happens around the certificate validation

  10. ManickaP commented on Feb 29, 2024

    @ManickaP
    Member

    @rzikm Could you also similarly describe what the problem is and how it manifests (not just the root cause)?

  11. rzikm commented on Feb 29, 2024

    @rzikm
    Member

    One way to look at it saying this is a data race between ConnectionCertificateValidationComplete and ConnectionShutdown when called in a quick succession (due to how MsQuic queues the operations, this is a race even if we call them from the same thread in .NET)

  12. ManickaP commented on Feb 29, 2024

    @ManickaP
    Member

    I understand this, I was more interested in how this translates to Handshake timeout on the other side.

  13. 1 remaining item

  14. added
    disabled-test
    on Feb 29, 2024
  15. added this to the 9.0.0 milestone on Feb 29, 2024
  16. removed
    untriaged
    on Feb 29, 2024
  17. removed
    blocking-clean-ci
    Known Build Error
    on Feb 29, 2024
  18. added
    tracking-external-issue
    on Jun 20, 2024
  19. rzikm commented on Jun 20, 2024

    @rzikm
    Member

    This issue will be resolved in 2.4 release of MsQuic.

  20. added
    disabled-test
    and removed
    disabled-test
    on Aug 11, 2024
  21. liveans commented on Aug 11, 2024

    @liveans
    Contributor

    This issue is fixed with msquic 2.4 release but looks like we're still disabling this test against msquic versions which is lower than 2.4 with ActiveIssue attribute and if we want to close the issue we should delete that attribute and delete disabled test label on issue, I think we should decide about what to do with it.

    • We can either convert ActiveIssue attribute to Version check logic inside code and let it run on all test suite and close this issue.
    • We can run this feature with msquic versions which is higher than 2.4

    I believe we can do the first option for the short term, but second option might be more reliable option here (has some perf downsides).

    I think we were going to discuss it, right? @rzikm

    Also deleting tracking-external-issue because action is on our side now.

  22. removed
    tracking-external-issue
    on Aug 11, 2024
  23. added
    in-pr
    on Aug 12, 2024
  24. rzikm commented on Aug 12, 2024

    @rzikm
    Member

    I think we were going to discuss it, right? @rzikm

    Last time I mentioned it in the team the feeling was to guarantee correct behavior even at cost of some perf.

    Since MsQuic 2.4.1+ is available, I don't expect bumping the required version for the feature is going to adversely affect anyone.

  25. locked and limited conversation to collaborators on Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Quicdisabled-testin-pr

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions