From 427fe276f2ff392b0342caef2a734b9063029643 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 6 Feb 2023 13:35:28 +0300 Subject: [PATCH] [#2238] shard: Try closing all components Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/shard/control.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index c96b267e..2f698c69 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -255,9 +255,11 @@ func (s *Shard) Close() error { components = append(components, s.blobStor, s.metaBase) + var lastErr error for _, component := range components { if err := component.Close(); err != nil { - return fmt.Errorf("could not close %s: %w", component, err) + lastErr = err + s.log.Error("could not close shard component", zap.Error(err)) } } @@ -266,7 +268,7 @@ func (s *Shard) Close() error { s.gc.stop() } - return nil + return lastErr } // Reload reloads configuration portions that are necessary.