mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Mitigate frozen predixy due to infinite TCP conn retry to a failed Redis cluster node
This commit is contained in:
parent
c15f54e274
commit
2380a4f252
@ -178,6 +178,13 @@ bool Socket::setTcpKeepAlive(int interval)
|
|||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Mitigate frozen predixy due to infinite TCP conn retry to a failed Redis cluster node
|
||||||
|
// https://github.com/joyieldInc/predixy/issues/136
|
||||||
|
val = 1000; // millisecond
|
||||||
|
ret = setsockopt(mFd, IPPROTO_TCP, TCP_USER_TIMEOUT, &val, sizeof(val));
|
||||||
|
if (ret != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
((void)interval); //Avoid unused var warning for non Linux systems
|
((void)interval); //Avoid unused var warning for non Linux systems
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user