Hello,
I am receiving quite often the following exception from ServiceStack.Redis client. For no apparent reason the following stack trace gets logged into my application. It does not matter what operation I am trying to perform with. It looks like a timeout issue with the pooled client, but it's just a guess:
ServiceStack.Redis.RedisResponseException: No more data, sPort: 50563, LastCommand:
at ServiceStack.Redis.RedisNativeClient.CreateResponseError(String error) in C:\src\ServiceStack.Redis\src\ServiceStack.Redis\RedisNativeClient_Utils.cs:line 148
at ServiceStack.Redis.RedisNativeClient.ExpectSuccess() in C:\src\ServiceStack.Redis\src\ServiceStack.Redis\RedisNativeClient_Utils.cs:line 384
at ServiceStack.Redis.RedisNativeClient.set_Db(Int32 value) in C:\src\ServiceStack.Redis\src\ServiceStack.Redis\RedisNativeClient.cs:line 138
at ServiceStack.Redis.PooledRedisClientManager.GetClient() in C:\src\ServiceStack.Redis\src\ServiceStack.Redis\PooledRedisClientManager.cs:line 143
I am using self compiled client from the latest bits in the repo.
public class RetryLogic
{
public static void RetryForExceptionType(Action action, Type retryOnExceptionType, int numRetries, int retryTimeout)
{
if (action == null)
throw new ArgumentNullException("action");
if (retryOnExceptionType == null)
throw new ArgumentNullException("retryOnExceptionType");
while (true)
{
try
{
action();
return;
}
catch (Exception e)
{
if (--numRetries <= 0 || !retryOnExceptionType.IsAssignableFrom(e.GetType()))
throw;
if (retryTimeout > 0)
System.Threading.Thread.Sleep(retryTimeout);
}
}
}
}