Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/borg/locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ def by_me(self):
return os.path.exists(self.unique_name)

def kill_stale_lock(self):
for name in os.listdir(self.path):
try:
names = os.listdir(self.path)
except FileNotFoundError:
# if another borg process won the race for killing a stale lock, we get here.
return False

for name in names:
try:
host_pid, thread_str = name.rsplit('-', 1)
host, pid_str = host_pid.rsplit('.', 1)
Expand Down