mark replication target offline if network timeouts seen (#17907)

regular target liveness check every 5 secs will toggle state back
as target returns online.
This commit is contained in:
Poorna
2023-08-24 09:24:26 -07:00
committed by GitHub
parent a2f0771fd3
commit 4a6af93c83
2 changed files with 28 additions and 2 deletions

View File

@@ -69,6 +69,16 @@ func (sys *BucketTargetSys) isOffline(ep *url.URL) bool {
return false
}
// markOffline sets endpoint to offline if network i/o timeout seen.
func (sys *BucketTargetSys) markOffline(ep *url.URL) {
sys.hMutex.Lock()
defer sys.hMutex.Unlock()
if h, ok := sys.hc[ep.Host]; ok {
h.Online = false
sys.hc[ep.Host] = h
}
}
func (sys *BucketTargetSys) initHC(ep *url.URL) {
sys.hMutex.Lock()
sys.hc[ep.Host] = epHealth{