Skip to content

[Known Build Error] TestServerTests.LongPollingWorks - ObjectDisposedException in OnDisconnectedAsync during shutdown #65702

Open

Description

@lewing

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1325148
Build error leg or test failing: Tests: Helix x64 Subset 2 / Microsoft.AspNetCore.SignalR.Client.Tests--net11.0
Pull request: #65694

Error Message

{
  "ErrorMessage": "Error when dispatching 'OnDisconnectedAsync' on hub",
  "BuildRetry": true,
  "ExcludeConsoleLog": false
}

Description

TestServerTests.LongPollingWorks fails intermittently when the test host shuts down and OnDisconnectedAsync races with IServiceProvider disposal. The HttpConnectionDispatcher.ProcessDeleteAsync fire-and-forgets server-side connection disposal, so when the host tears down, DefaultHubDispatcher.OnDisconnectedAsync can attempt to call CreateAsyncScope() on an already-disposed ServiceProvider, throwing ObjectDisposedException.

Stack trace:

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateScope()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.CreateScope()
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.CreateAsyncScope(IServiceScopeFactory serviceScopeFactory)
   at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubConnectionContext connection, Exception exception)
   at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)

Fix in progress: #65457 catches ObjectDisposedException at the DI boundary in DefaultHubDispatcher.OnDisconnectedAsync.

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1325148
Error message validated: [Error when dispatching 'OnDisconnectedAsync' on hub]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 3/7/2026 10:12:12 PM UTC

Report

💡 View the full list in 🌐 Build Insights

Build Repository Branch Step Name Log Pull Request
3145251 dotnet-aspnetcore internal/release/8.0 Run E2E tests 📄 #69253
3143975 dotnet-aspnetcore internal/release/8.0 Run E2E tests 📄 #69148
3140227 dotnet-aspnetcore Run E2E tests 📄 #68999
3140143 dotnet-aspnetcore Run E2E tests 📄 #68992
3138894 dotnet-aspnetcore Run E2E tests 📄 #68902
3133482 dotnet-aspnetcore Run E2E tests 📄 #68600
1672049 dotnet/aspnetcore release/8.0 Run E2E tests 📄 #70413
1668643 dotnet/aspnetcore release/8.0 Run E2E tests 📄
Build Repository Branch Test Pull Request
1703422 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1702552 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1700145 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1699379 dotnet/aspnetcore release/10.0 Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent #70802
1699046 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.Internal.HubGroupListTests.ConcurrentAddAndRemoveDoesNotLoseConnections
1698260 dotnet/aspnetcore release/10.0 Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent #70802
1696049 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.Internal.HubGroupListTests.ConcurrentAddAndRemoveDoesNotLoseConnections
1694176 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1693933 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1693791 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.Internal.HubGroupListTests.ConcurrentAddAndRemoveDoesNotLoseConnections
1693526 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1693161 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1691190 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1689981 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1689078 dotnet/aspnetcore release/10.0 Microsoft.AspNetCore.SignalR.Client.Tests.TestServerTests.WebSocketsWorks
1689056 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1684603 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1682461 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1682082 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1681276 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1679511 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1678747 dotnet/aspnetcore main Microsoft.AspNetCore.SignalR.Tests.HubConnectionHandlerTests.DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent
1672494 dotnet/aspnetcore release/11.0 Microsoft.AspNetCore.SignalR.Tests.HubFilterTests.FiltersHaveTransientScopeByDefault
1668612 dotnet/aspnetcore release/10.0 Microsoft.AspNetCore.SignalR.Client.Tests.TestServerTests.LongPollingWorks

Summary

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

Activity

  1. added
    area-signalr
    Known Build Error
    on Mar 7, 2026
  2. MihuBot commented on Mar 7, 2026

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  3. github-actions commented on Mar 18, 2026

    @github-actions
    Contributor

    This test is being quarantined via PR due to continued intermittent failures. The test fails with System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider' occurring in OnDisconnectedAsync after the host shuts down.

    The root cause appears to be a race condition during host shutdown where the IServiceProvider is disposed before the long-polling connection's disconnect handler completes. Quarantine PR is being opened to unblock CI.

    Generated by Daily Test Quarantine Management · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Known Build Errorarea-signalr

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions