Commit b901aa3c authored by Jon Cole's avatar Jon Cole

Add ThreadPool and CPU summary to connection related errors.

parent 1f514259
......@@ -2071,6 +2071,14 @@ internal T ExecuteSyncImpl<T>(Message message, ResultProcessor<T> processor, Ser
}
#if !CORE_CLR
internal static string GetThreadPoolAndCPUSummary()
{
string iocp, worker;
GetThreadPoolStats(out iocp, out worker);
var cpu = GetSystemCpuPercent();
return $"IOCP: {iocp}, WORKER: {worker}, Local-CPU: {cpu}";
}
private static string GetSystemCpuPercent()
{
float systemCPU;
......
......@@ -86,6 +86,13 @@ internal static Exception NoConnectionAvailable(bool includeDetail, RedisCommand
serverSnapshot = new ServerEndPoint[] { server };
}
string exceptionmessage = "No connection is available to service this operation: " + s ;
#if !CORE_CLR
if (includeDetail)
{
exceptionmessage += ". " + ConnectionMultiplexer.GetThreadPoolAndCPUSummary();
}
#endif
var ex = new RedisConnectionException(ConnectionFailureType.UnableToResolvePhysicalConnection, exceptionmessage, GetServerSnapshotInnerExceptions(serverSnapshot));
if (includeDetail)
{
......
......@@ -164,7 +164,10 @@ public virtual bool SetResult(PhysicalConnection connection, Message message, Ra
}
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);
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);
#if !CORE_CLR
err += ConnectionMultiplexer.GetThreadPoolAndCPUSummary();
#endif
}
}
}
......
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