-
Notifications
You must be signed in to change notification settings - Fork 987
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
not trigger the channelInactive() method in ConnectionWatchdog #3100
Comments
Hey @TomGitHome, When changing the You can read more details about this condition in the following article. To make sure you do not run into the same problem, could you verify that you are following the best practices described in the Redis documentation? Important The suggested values in the article are sample values, you need to use the ones that make sense for your system, the basic recommendation is to follow the rule TCP_USER_TIMEOUT = TCP_KEEP_IDLE+TCP_KEEPINTVL * TCP_KEEPCNT |
@tishun |
Hey @TomGitHome , I do not see in your configuration the setting for the TCP_USER_TIMEOUT? SocketOptions socketOptions = SocketOptions.builder()
.keepAlive(keepAliveOptions)
.connectTimeout(Duration.ofSeconds(10))
.tcpUserTimeout(tcpUserTimeout) // <--- THIS IS MISSING
.build(); ... and if you want to use the same setting as the one in the example you'd have to add this too: SocketOptions.TcpUserTimeoutOptions tcpUserTimeout = SocketOptions.TcpUserTimeoutOptions.builder()
.tcpUserTimeout(Duration.ofSeconds(20))
.enable().build(); |
Environment
Basic Information:
There are two servers, one acting as the primary server and the other as the standby.
Both the primary and standby servers deploy Redis in Docker containers, and both are running.
The Spring Boot project is deployed in a Docker container.
The Spring Boot project uses Lettuce to connect to the Redis service.
Issue Description:
Currently, the Redis virtual IP is on the standby server. When using iptables -A INPUT -p tcp --dport 6379 -j REJECT on the standby server to bring Redis down, the Redis virtual IP automatically switches to the primary server. This triggers the channelInactive() method in ConnectionWatchdog, and the connection to the Redis service is restored successfully.
After Redis is restored on the standby server by using iptables -D INPUT -p tcp --dport 6379 -j REJECT, and then Redis is brought down on the primary server by executing iptables -A INPUT -p tcp --dport 6379 -j REJECT, the Redis virtual IP automatically switches to the standby server. However, this does not trigger the channelInactive() method in ConnectionWatchdog, and the connection to the Redis service remains abnormal for about 18 minutes before recovering.
The text was updated successfully, but these errors were encountered: