Skip to content

Commit

Permalink
Rollback namespace transactions when bucket is not found.
Browse files Browse the repository at this point in the history
This fixes a deadlock where failed transactions due to the namespaces'
bucket being missing would cause deadlocks due to bolt's mmap rwmutex
still being read or write locked (and no way to unlock it, since the
underlying bolt tx was not returned on failure).
  • Loading branch information
jrick authored and jcvernaleo committed Apr 6, 2016
1 parent fb01141 commit 29efe24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions walletdb/bdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func (ns *namespace) Begin(writable bool) (walletdb.Tx, error) {

bucket := boltTx.Bucket(ns.key)
if bucket == nil {
boltTx.Rollback()
return nil, walletdb.ErrBucketNotFound
}

Expand Down

0 comments on commit 29efe24

Please sign in to comment.