From 2229509362c4b4b823508fd84ca5084ea7fe7dba Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Thu, 9 Nov 2023 09:33:32 -0800 Subject: [PATCH] fix: leaking offline disks in MarkOffline() thread (#18414) `monitorAndConnectEndpoints` will continue to attempt to reconnect offline disks. Since disks were never closed, a `MarkOffline` would continue to try to check these disks forever. Close previous disks. --- cmd/erasure-sets.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/erasure-sets.go b/cmd/erasure-sets.go index ca6618e82..20987520c 100644 --- a/cmd/erasure-sets.go +++ b/cmd/erasure-sets.go @@ -217,6 +217,10 @@ func (s *erasureSets) connectDisks() { continue } } + if cdisk != nil { + // Close previous offline disk. + cdisk.Close() + } wg.Add(1) go func(endpoint Endpoint) {