forked from TrueCloudLab/frostfs-node
[#2238] shard: Try closing all components
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
c53903ccd0
commit
427fe276f2
1 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue