SignalR stateful reconnect: keep-alive ping can keep holding `HubConnectionContext._writeLock` after reconnect/disconnect

Open
#70,332 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp

Research direction

Read HttpConnectionContext.UpdateConnectionPair and HubConnectionContext.TryWritePingAsync at the linked locations, then trace how reconnect replaces the transport pipe and how keep-alive writes handle cancellation. Reproduce the issue using the steps and byte threshold in the report. Done when reconnect or termination releases the pending flush and _writeLock, so sends to the disconnected client complete.

Written by the indexing model from the issue text.

Description

area-signalr

Unlike ordinary hub writes, keep-alive pings don't observe connection termination. TryWritePingAsync has an existing TODO for cancellation
https://github.com/dotnet/aspnetcore/blob/70dc164847bb029321a3d0eea9b74db1fdb48055/src/SignalR/server/Core/src/HubConnectionContext.cs#L541-L552

Dominant language
C#
Stars
38.5k
Forks
11.6k
Avg merge
3d 1h
Merged PRs (30d)
289

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/aspnetcore

All issues in dotnet/aspnetcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.