From 2ca09a0443fcb386d1a783f32b759dec58e07bba Mon Sep 17 00:00:00 2001 From: Matiszak Date: Wed, 16 Aug 2023 10:17:06 +0000 Subject: [PATCH] Do not send tracers when running second iteration of cluster nodes discovery (#2520) 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. --- src/StackExchange.Redis/ConnectionMultiplexer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/StackExchange.Redis/ConnectionMultiplexer.cs b/src/StackExchange.Redis/ConnectionMultiplexer.cs index 88c6c37c2..37b4dea4a 100644 --- a/src/StackExchange.Redis/ConnectionMultiplexer.cs +++ b/src/StackExchange.Redis/ConnectionMultiplexer.cs @@ -1478,8 +1478,9 @@ internal async Task ReconfigureAsync(bool first, bool reconfigureAll, LogP servers[i] = server; // This awaits either the endpoint's initial connection, or a tracer if we're already connected - // (which is the reconfigure case) - available[i] = server.OnConnectedAsync(log, sendTracerIfConnected: true, autoConfigureIfConnected: reconfigureAll); + // (which is the reconfigure case, except second iteration which is only for newly discovered cluster members). + var isFirstIteration = iter == 0; + available[i] = server.OnConnectedAsync(log, sendTracerIfConnected: isFirstIteration, autoConfigureIfConnected: reconfigureAll); } watch ??= ValueStopwatch.StartNew();