Repository navigation
Fix SignalR sharded subscriptions racing Redis Cluster startup - #2830
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge. SummaryThe router now finishes its first
|
Review of #2830I found no bugs or blocking design problems at head What changed
Why I think it's correct
Tests
Reviews and open items
Nothing needs action. |
Pull request was converted to draft
fbae311 to
8fd3d45
Compare
|
@codex review Rebased onto main to pick up the CI gate fix from #2837. The previous CI run passed every build and test, then failed on the automatic Claude review startup. The rebase preserved the patch. All 191 focused Cluster tests and 93 SignalR tests passed on each of .NET 10 and .NET 11. All four Release builds finished with zero warnings and errors, and all 12 CI gate tests passed. |
|
No blocking issues. I read the diff and the surrounding router code, but I did not build or run the tests. The fix (
Regression test (
SignalR test host: error-level console logging is enabled only for cluster hosts. A long-polling HTTP 500 will now come with the server-side cause in the test output. Optional, not blocking: the comment at line 449 explains why The PR description notes one remaining message-delivery timeout, tracked in #2829. It is outside this change. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
The comment beside |
Fix
A SignalR host can start its background Redis
PINGwhile the first long-polling client is connecting. The Cluster router published the seed before its initialCLUSTER SLOTSquery finished. A sharded subscription could then use the seed while the slot map was empty. Redirects and topology updates during backplane startup could start subscription recovery, which rejected the next subscription fromOnConnectedAsync. The client had completed the handshake and saw HTTP 500 when invokingIdentity.Publish the seed after the initial slot query completes. When Redis supplies a map, concurrent subscribers go straight to the slot primary. A server that declines the topology query can still serve as the seed. Cluster test hosts now log server errors so a failed poll carries diagnostics in the test output.
Reproduction
The original smoke job recorded only the client stack. In a local run using the same TUnit version and Redis image, a temporary 40 ms delay before the initial slot query reproduced 89 HTTP 500 responses in 512 sharded MessagePack cases. The server logged
RespireConnectionException: Sharded pub/sub recovery is in progress. Subscribe again after recovery completes.One additional case lost a client-result heartbeat under load.The regression test holds the first slot reply while starting a sharded subscription. Before the fix, both RESP2 and RESP3 sent
SSUBSCRIBE footo the seed even though the second primary owns its slot.Scope
#2807 changes test parallelism. #2816 adds subscriber queries through #2825. This fix addresses Cluster startup ordering independently of both changes.
Validation
Closes #2824