mirror of https://github.com/borgbackup/borg.git
commit
a69ee0bddb
|
@ -186,6 +186,7 @@ class RemoteRepository:
|
|||
raise Repository.ObjectNotFound(res[0], self.location.orig)
|
||||
elif error == b'InvalidRPCMethod':
|
||||
raise InvalidRPCMethod(*res)
|
||||
else:
|
||||
raise self.RPCError(res.decode('utf-8'))
|
||||
else:
|
||||
yield res
|
||||
|
|
|
@ -145,7 +145,14 @@ class Repository:
|
|||
|
||||
def prepare_txn(self, transaction_id, do_cleanup=True):
|
||||
self._active_txn = True
|
||||
try:
|
||||
self.lock.upgrade()
|
||||
except UpgradableLock.WriteLockFailed:
|
||||
# if upgrading the lock to exclusive fails, we do not have an
|
||||
# active transaction. this is important for "serve" mode, where
|
||||
# the repository instance lives on - even if exceptions happened.
|
||||
self._active_txn = False
|
||||
raise
|
||||
if not self.index:
|
||||
self.index = self.open_index(transaction_id)
|
||||
if transaction_id is None:
|
||||
|
|
Loading…
Reference in New Issue