Skip to content

Commit

Permalink
blockstore: try to close during Finalize(), even in case of previous …
Browse files Browse the repository at this point in the history
…error

Co-authored-by: Rod Vagg <rod@vagg.org>
  • Loading branch information
MichaelMure and rvagg committed Mar 7, 2023
1 parent b6ef2a4 commit 34f4b63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions v2/blockstore/readwrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,10 @@ func (b *ReadWrite) Finalize() error {
b.ronly.mu.Lock()
defer b.ronly.mu.Unlock()

if err := b.finalizeReadOnlyWithoutMutex(); err != nil {
return err
}
if err := b.closeWithoutMutex(); err != nil {
return err
for _, err := range []error{b.finalizeReadOnlyWithoutMutex(), b.closeWithoutMutex()} {
if err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit 34f4b63

Please sign in to comment.