Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/StackExchange.Redis/ConnectionMultiplexer.Sentinel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
4 changes: 2 additions & 2 deletions src/StackExchange.Redis/ConnectionMultiplexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
/// </summary>
public Task<bool> 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<bool> ReconfigureAsync(bool first, bool reconfigureAll, ILogger? log, EndPoint? blame, string cause, bool publishReconfigure = false, CommandFlags publishReconfigureFlags = CommandFlags.None)
{
Expand Down
9 changes: 7 additions & 2 deletions src/StackExchange.Redis/ExceptionFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/StackExchange.Redis/PhysicalBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading