-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
连接redis 时redis未就绪,等redis启动完成后,执行xreadgroup报错:Unable to read data from the transport connection: Connection timed out #485
Comments
该错误代表连接超时 |
但是我并没有做什么,ping这个redis服务成功后就执行这个命令,然后就报超时,我应该做什么呢?重新new这个客户端 |
重新new 后还是会报错的 |
ping 只是服务器能通,不一定是端口能通 如果 redis-server 没有改端口,默认是 6379 测试方法:
|
确认reids-server服务已经可用,但是之后操作xreadgroup 方法还是一直报Unable to read data from the transport connection: Connection timed out 像是连接池中连接超时了,可是我执行IsAvailable返回true了 ,有什么方法可以重置连接池连接吗?或者说我怎么样做才能让连接恢复正常,因为我要在代码中检测redis服务就绪,就绪后执行某些操作redis方法,有什么好的方式实现吗? |
我跑的 csredis 的ping方法 |
xreadgroup 是阻塞的,是不是设置太长的超时时间了。 这个时间不能设置大于 Socket.ReceiveTimeout 的值,大约15秒 否则就触发了 socket receive timeout 错误。 |
如果想等待100秒,建议加个循环处理: for (var i = 0; i < 10; i++) |
我现在把xreadgroup 阻塞时间改为1秒,在while循环中执行,还是报错csreids |
请问在初始化redis连接时,redis-server没有就绪,过大概一分钟后就绪,三方库内部知道redis恢复了,为什么连接池里的连接都超时了,连接池默认连接数50个,这50个都不可用了,感觉这个问题的本质还是连接池里的连接在redis-server就绪后为什么都不可用了 |
哪个版本,不可用后需要等待恢复,每5秒检测一次 |
3.8.669 这个版本 不可用后需要等待恢复,每5秒检测一次这个指的是redis-server 还是连接池里的连接 |
链接池里面,建议早切换到FreeRedis |
FreeRedis对redis5.0以上版本支持更完善 |
No description provided.
The text was updated successfully, but these errors were encountered: