diff --git a/pkg/local_object_storage/blobstor/blobovnicza.go b/pkg/local_object_storage/blobstor/blobovnicza.go index daeb5ce28a..039c89358c 100644 --- a/pkg/local_object_storage/blobstor/blobovnicza.go +++ b/pkg/local_object_storage/blobstor/blobovnicza.go @@ -596,6 +596,28 @@ func (b *blobovniczas) init() error { }) } +// closes blobovnicza tree. +func (b *blobovniczas) close() error { + b.opened.Purge() + + b.activeMtx.Lock() + + for p, v := range b.active { + if err := v.blz.Close(); err != nil { + b.log.Debug("could not close active blobovnicza", + zap.String("path", p), + zap.String("error", err.Error()), + ) + } + + delete(b.active, p) + } + + b.activeMtx.Unlock() + + return nil +} + // opens and returns blobovnicza with path p. // // If blobovnicza is already opened and cached, instance from cache is returned w/o changes.