Rollback namespace transactions when bucket is not found.

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).
This commit is contained in:
Josh Rickmar 2016-04-05 11:46:42 -04:00
parent e12d23716f
commit d2c851431b

View file

@ -290,6 +290,7 @@ func (ns *namespace) Begin(writable bool) (walletdb.Tx, error) {
bucket := boltTx.Bucket(ns.key)
if bucket == nil {
boltTx.Rollback()
return nil, walletdb.ErrBucketNotFound
}