[#2238] shard: Try closing all components

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/62/head
Evgenii Stratonikov 2023-02-06 13:35:28 +03:00 committed by fyrchik
parent c53903ccd0
commit 427fe276f2
1 changed files with 4 additions and 2 deletions

View File

@ -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.