diff --git a/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs b/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs index 7753954d0..88e42ed5e 100644 --- a/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs +++ b/src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs @@ -463,7 +463,7 @@ internal void UpdateSentinelAddressList(string serviceName) if (hasNew) { // Reconfigure the sentinel multiplexer if we added new endpoints - ReconfigureAsync(first: false, reconfigureAll: true, null, EndPoints[0], "Updating Sentinel List", false).Wait(); + ReconfigureAsync(first: false, reconfigureAll: true, Logger, EndPoints[0], "Updating Sentinel List", false).Wait(); } } } diff --git a/src/StackExchange.Redis/ConnectionMultiplexer.cs b/src/StackExchange.Redis/ConnectionMultiplexer.cs index 8a4b8733d..e17a9503b 100644 --- a/src/StackExchange.Redis/ConnectionMultiplexer.cs +++ b/src/StackExchange.Redis/ConnectionMultiplexer.cs @@ -1378,7 +1378,7 @@ internal bool ReconfigureIfNeeded(EndPoint? blame, bool fromBroadcast, string ca { bool reconfigureAll = fromBroadcast || publishReconfigure; Trace("Configuration change detected; checking nodes", "Configuration"); - ReconfigureAsync(first: false, reconfigureAll, null, blame, cause, publishReconfigure, flags).ObserveErrors(); + ReconfigureAsync(first: false, reconfigureAll, Logger, blame, cause, publishReconfigure, flags).ObserveErrors(); return true; } else @@ -1393,7 +1393,7 @@ internal bool ReconfigureIfNeeded(EndPoint? blame, bool fromBroadcast, string ca /// This re-assessment of all server endpoints to get the current topology and adjust, the same as if we had first connected. /// public Task ReconfigureAsync(string reason) => - ReconfigureAsync(first: false, reconfigureAll: false, log: null, blame: null, cause: reason); + ReconfigureAsync(first: false, reconfigureAll: false, log: Logger, blame: null, cause: reason); internal async Task ReconfigureAsync(bool first, bool reconfigureAll, ILogger? log, EndPoint? blame, string cause, bool publishReconfigure = false, CommandFlags publishReconfigureFlags = CommandFlags.None) { diff --git a/src/StackExchange.Redis/ExceptionFactory.cs b/src/StackExchange.Redis/ExceptionFactory.cs index 24e519b54..7e4eca49a 100644 --- a/src/StackExchange.Redis/ExceptionFactory.cs +++ b/src/StackExchange.Redis/ExceptionFactory.cs @@ -408,9 +408,14 @@ private static string GetLabel(bool includeDetail, RedisCommand command, Message return message == null ? command.ToString() : (includeDetail ? message.CommandAndKey : message.CommandString); } - internal static Exception UnableToConnect(ConnectionMultiplexer muxer, string? failureMessage = null) + internal static Exception UnableToConnect(ConnectionMultiplexer muxer, string? failureMessage = null, string? connectionName = null) { - var sb = new StringBuilder("It was not possible to connect to the redis server(s)."); + var sb = new StringBuilder("It was not possible to connect to the redis server(s)"); + if (connectionName is not null) + { + sb.Append(' ').Append(connectionName); + } + sb.Append('.'); Exception? inner = null; var failureType = ConnectionFailureType.UnableToConnect; if (muxer is not null) diff --git a/src/StackExchange.Redis/PhysicalBridge.cs b/src/StackExchange.Redis/PhysicalBridge.cs index c697ed7f6..a10b241cb 100644 --- a/src/StackExchange.Redis/PhysicalBridge.cs +++ b/src/StackExchange.Redis/PhysicalBridge.cs @@ -584,7 +584,7 @@ internal void OnHeartbeat(bool ifConnectedOnly) if (DueForConnectRetry()) { Interlocked.Increment(ref connectTimeoutRetryCount); - var ex = ExceptionFactory.UnableToConnect(Multiplexer, "ConnectTimeout"); + var ex = ExceptionFactory.UnableToConnect(Multiplexer, "ConnectTimeout", Name); LastException = ex; Multiplexer.Logger?.LogError(ex, ex.Message); Trace("Aborting connect");