Commit 5688bc11 authored by Marc Gravell's avatar Marc Gravell Committed by GitHub

Merge pull request #451 from hrishi18pathak/SEClusterConfigBugFix

Surface better error instead of MOVED errors during a network disconnect in redis clusters 
parents 2fd4b123 7d74d187
......@@ -141,6 +141,7 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra
var server = bridge.ServerEndPoint;
bool log = !message.IsInternalCall;
bool isMoved = result.AssertStarts(MOVED);
string err = string.Empty;
if (isMoved || result.AssertStarts(ASK))
{
message.SetResponseReceived();
......@@ -161,11 +162,19 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra
connection.Multiplexer.Trace(message.Command + " re-issued to " + endpoint, isMoved ? "MOVED" : "ASK");
return false;
}
else
{
err = string.Format("Endpoint {0} serving hashslot {1} is not reachable at this point of time. Please check connectTimeout value. If it is low, try increasing it to give the ConnectionMultiplexer a chance to recover from the network disconnect.", endpoint, hashSlot);
}
}
}
}
string err = result.GetString();
if (string.IsNullOrWhiteSpace(err))
{
err = result.GetString();
}
if (log)
{
bridge.Multiplexer.OnErrorMessage(server.EndPoint, err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment