mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
grid: Fix a window of a disconnected node not marked as offline (#19703)
LastPong is saved as nanoseconds after a connection or reconnection but saved as seconds when receiving a pong message. The code deciding if a pong is too old can be skewed since it assumes LastPong is only in seconds.
This commit is contained in:
@@ -867,7 +867,7 @@ func (c *Connection) updateState(s State) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if s == StateConnected {
|
if s == StateConnected {
|
||||||
atomic.StoreInt64(&c.LastPong, time.Now().UnixNano())
|
atomic.StoreInt64(&c.LastPong, time.Now().Unix())
|
||||||
}
|
}
|
||||||
atomic.StoreUint32((*uint32)(&c.state), uint32(s))
|
atomic.StoreUint32((*uint32)(&c.state), uint32(s))
|
||||||
if debugPrint {
|
if debugPrint {
|
||||||
|
|||||||
Reference in New Issue
Block a user