简体   繁体   English

Redis服务器重启后,服务堆栈Redis重新连接

[英]Service Stack Redis reconnect after Redis server reboot

We are using Service Stack's RedisClient's BlockingDequeue to persist some data until it can be processed. 我们使用Service Stack的RedisClient的BlockingDequeue来保存一些数据,直到它可以被处理。 The calling code looks like 调用代码看起来像

 using (var client = ClientPool.GetClient())
            return client.As<TMessage>().Lists[_channel].BlockingDequeue(timeout);

If the server hosting Redis is restarted, the connections for the BlockingDequeue go zombie and never return until the client application is restarted. 如果重新启动托管Redis的服务器,则BlockingDequeue的连接将变为僵尸,并且在重新启动客户端应用程序之前永远不会返回。

We have tried setting the timeout on the BlockingDequeue as well as the PooledConnectionManager but neither helped, I am guessing because the timeout is enforced on the server side. 我们已经尝试在BlockingDequeue和PooledConnectionManager上设置超时但是没有帮助,我猜是因为超时是在服务器端强制执行的。

Is this type of fault tolerance built into service stack and we are missing it? 这种类型的容错是否构建在服务堆栈中,我们错过了它?

Or is it something that our implementation should handle? 或者是我们的实现应该处理的东西? If so are there any recommended approaches? 如果有,是否有任何推荐的方法?

我们在ServiceStack.Redis订阅代码中遇到了同样的问题,我们尝试了一些设置,例如retrycount,retrytimeout等,它们都不起作用,稍后我们的解决方法是捕获RedisException并再次进行订阅。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM