Reputation: 1917
I am getting what looks like a timeout exception when using a BlockingDequeue on a RedisTypedClient.
The calling code looks like
using (var client = ClientPool.GetClient())
return client.As<TMessage>().Lists[_channel].BlockingDequeue(timeout);
Where the timeout is set to 0 and the ClientPool is a PooledRedisClientManager.
The stack trace looks like
ServiceStack.Redis.RedisResponseException: No more data, sPort: 51100, LastCommand:
at ServiceStack.Redis.RedisNativeClient.CreateResponseError(String error)
at ServiceStack.Redis.RedisNativeClient.ReadMultiData()
at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte[][] cmdWithBinaryArgs)
at ServiceStack.Redis.RedisNativeClient.BRPop(String listId, Int32 timeOutSecs)
at ServiceStack.Redis.Generic.RedisTypedClient`1.BlockingDequeueItemFromList(IRedisList`1 fromList, Nullable`1 timeOut)
at ServiceStack.Redis.Generic.RedisClientList`1.BlockingDequeue(Nullable`1 timeOut)
From what I can find, this is an issue with the client holding an open connection. I thought this was supposed to be fixed by using the PooledRedisClientManager, but it seems to still happen. The issue is easy to reproduce. Simply call the BlockingDequeue method and wait about 2-3 minutes and the exception throws.
Upvotes: 2
Views: 1637
Reputation: 10395
I had this once on Windows Azure and on redis i did config set timeout 30
and in ServiceStack.Redis i did
var redisFactory = new PooledRedisClientManager(redisConn);
redisFactory.ConnectTimeout = 5;
redisFactory.IdleTimeOutSecs = 30;
And now for some reason it works
Upvotes: 3
Reputation: 1917
It turns out we were sending our Redis requests through a dns entry that was pointing towards an F5 Big IP traffic controller that was setup to drop idle connections after 300 seconds. Once we increased the timeout on the Big IP the error stopped occurring.
Upvotes: 2