1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 08:45:13 +00:00
Commit graph

20 commits

Author SHA1 Message Date
Marian Beermann
928f6e0ca4 repository: fix spurious, empty lock.roster on InvalidRepository exception 2016-08-18 00:54:12 +02:00
Thomas Waldmann
d3d51e12ea rename UpgradableLock to Lock
lock upgrading is troublesome / may deadlock, do not advertise it.
2016-08-05 19:06:09 +02:00
Thomas Waldmann
26007c0162 add Lock.got_exclusive_lock 2016-08-05 18:52:20 +02:00
Thomas Waldmann
2f21488e81 fix most python-source related sphinx warnings 2016-07-10 17:26:04 +02:00
Thomas Waldmann
f486a6772c do not sleep for >60s while waiting for lock, fixes #773 2016-03-19 21:19:30 +01:00
Thomas Waldmann
4b339f5d69 cosmetic source cleanup (flake8) 2016-01-30 21:32:45 +01:00
Thomas Waldmann
7773e632db fix some minor cosmetic code/docs issues 2016-01-30 00:01:13 +01:00
Thomas Waldmann
fc52101d46 suppress unneeded exception context (PEP 409) 2016-01-24 15:36:04 +01:00
Thomas Waldmann
a6f9c29dfe use new OS and IO exception hierarchy of py 3.3 2016-01-24 15:36:04 +01:00
Thomas Waldmann
845d2144cb fix locking, partial fix for #502
the problem was that the borg process removed its own shared lock when upgrading it to an exclusive lock.
this is fine if we get the exclusive lock, but if we don't, we must re-add our shared lock.

this fixes the KeyError in locking.py:217
2016-01-16 18:03:58 +01:00
Thomas Waldmann
1093894be8 UpgradableLock: release exclusive lock in case of exceptions
also: add some comments about how to use the locks in the safest way
2015-11-21 16:53:33 +01:00
Thomas Waldmann
f19e95fcf7 implement --lock-wait, support timeout for UpgradableLock, fixes #210
also: simplify exceptions / exception handling
2015-11-21 15:34:51 +01:00
Thomas Waldmann
762fdaadd8 prettier error messages, fixes #57
subclasses of "Error": do not show traceback
(this is used when a failure is expected and has rather trivial reasons and usually
does not need debugging)

subclasses of "ErrorWithTraceback": show a traceback
(this is for severe and rather unexpected stuff, like consistency / corruption issues
or stuff that might need debugging)

I reviewed all the Error subclasses whether they fit into the one or other class.

Also: fixed docstring typo, docstring formatting
2015-10-31 22:23:32 +01:00
Thomas Waldmann
dd577bf4ac fuse mount: fix unlocking of repository at umount time, fixes #331
there were 2 issues:
lock used another pid and tid than release because daemonize() made it different processes/threads.
solved by just determining PID only once and not using TID any more.

the other issue was that the repo needed and explicit closing.
2015-10-27 22:37:36 +01:00
Thomas Waldmann
c50f32426b do not crash on empty lock.roster, fixes #232 2015-10-05 23:23:59 +02:00
Thomas Waldmann
0a2bd8dad5 lock roster: catch file not found in remove() method and ignore it 2015-08-20 18:40:24 +02:00
Thomas Waldmann
b2f460d591 fix filenames used for locking, update docs about locking 2015-07-13 23:20:46 +02:00
Thomas Waldmann
2deb520e67 locking code: extract timeout/sleep code into reusable TimeoutTimer class 2015-07-13 16:45:18 +02:00
Thomas Waldmann
e4c519b1e9 new locking code
exclusive locking by atomic mkdir fs operation
on top of that, shared (read) locks and exclusive (write) locks using a json roster.
2015-07-13 13:55:28 +02:00
Thomas Waldmann
434dac0e48 move locking code to own module, same for locking tests
fix imports, no other changes.
2015-07-12 23:41:52 +02:00