Skip to content

Commit cd7a3b2

Browse files
committed
Physical bridge: handle the reconnect count case
Without this, we don't increase the current count and don't escalate in the exponential retry case, so let's both do that and log that something is happening so we can diagnose from the logs.
1 parent 50f2218 commit cd7a3b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/StackExchange.Redis/PhysicalBridge.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,10 @@ internal void OnHeartbeat(bool ifConnectedOnly)
685685
}
686686
if (!ifConnectedOnly && DueForConnectRetry())
687687
{
688-
Multiplexer.Trace("Resurrecting " + ToString());
688+
// Increment count here, so that we don't re-enter in Connecting case up top - we don't want to re-enter and log there.
689+
Interlocked.Increment(ref connectTimeoutRetryCount);
690+
691+
Multiplexer.Logger?.LogInformation($"Resurrecting {ToString()} (retry: {connectTimeoutRetryCount})");
689692
Multiplexer.OnResurrecting(ServerEndPoint.EndPoint, ConnectionType);
690693
TryConnect(null);
691694
}

0 commit comments

Comments
 (0)