Skip to content

Commit 5504ed9

Browse files
authored
Do not send tracers when running second iteration of cluster nodes di… (#2525)
Sending tracers is not necessary because we just connected to the nodes a few seconds ago. It causes problems because sent tracers do not have enough time to respond.
1 parent cfb110c commit 5504ed9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Current package versions:
1818

1919
- Change: Target net6.0 instead of net5.0, since net5.0 is end of life. ([#2497 by eerhardt](https://github.com/StackExchange/StackExchange.Redis/pull/2497))
2020
- Fix: Fix nullability annotation of IConnectionMultiplexer.RegisterProfiler ([#2494 by eerhardt](https://github.com/StackExchange/StackExchange.Redis/pull/2494))
21+
- Fix [#2520](https://github.com/StackExchange/StackExchange.Redis/issues/2520): Improve cluster connections in down scenarios by not re-pinging successful nodes ([#2525 by Matiszak](https://github.com/StackExchange/StackExchange.Redis/pull/2525))
2122
- Add: `Timer.ActiveCount` under `POOL` in timeout messages on .NET 6+ to help diagnose timer overload affecting timeout evaluations ([#2500 by NickCraver](https://github.com/StackExchange/StackExchange.Redis/pull/2500))
2223
- Add: `LibraryName` configuration option; allows the library name to be controlled at the individual options level (in addition to the existing controls in `DefaultOptionsProvider`) ([#2502 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2502))
2324
- Add: `DefaultOptionsProvider.GetProvider` allows lookup of provider by endpoint ([#2502 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2502))

src/StackExchange.Redis/ConnectionMultiplexer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,8 +1487,9 @@ internal async Task<bool> ReconfigureAsync(bool first, bool reconfigureAll, ILog
14871487
servers[i] = server;
14881488

14891489
// This awaits either the endpoint's initial connection, or a tracer if we're already connected
1490-
// (which is the reconfigure case)
1491-
available[i] = server.OnConnectedAsync(log, sendTracerIfConnected: true, autoConfigureIfConnected: reconfigureAll);
1490+
// (which is the reconfigure case, except second iteration which is only for newly discovered cluster members).
1491+
var isFirstIteration = iter == 0;
1492+
available[i] = server.OnConnectedAsync(log, sendTracerIfConnected: isFirstIteration, autoConfigureIfConnected: reconfigureAll);
14921493
}
14931494

14941495
watch ??= ValueStopwatch.StartNew();

0 commit comments

Comments
 (0)