bzr should automatically break locks from dead processes on the local machine

Bug #588431 reported by Jean-Paul Calderone
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I had a "bzr checkout" running when a Windows vm crashed. When I started the vm up again, re-running the "bzr checkout" command resulted in this message about locks:

Unable to obtain lock file:///C:/twistedbot/winxp32-py2.5-msi/Twisted/.bzr/branch/lock
held by exarkun@bigdog-xp-vm3 on host bigdog-xp-vm3 [process #1832]
locked 49 hours, 46 minutes ago
Will continue to try until 15:02:16, unless you press Ctrl-C.
See "bzr help break-lock" for more.

After manually breaking the lock in another console, it proceeded to fail this way:

bzr: ERROR: This tree contains left-over files from a failed operation.
    Please examine C:/twistedbot/winxp32-py2.5-msi/Twisted/.bzr/checkout/limbo to see if it contains any files you wish to
    keep, and delete it when you are done.

I'm not sure what the problem is with the latter part of this failure. However, for the former, I don't see why I should manually have to break the lock involved. The system has been rebooted since the lock was acquired. The process cannot possibly be running anymore. bzr should be able to "break" the lock itself.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 588431] [NEW] bzr locks persist across reboots

We use the persistent locks when accessing branch and repository
objects over FTP and SFTP, and we need, for correctness, to exclude
FTP and SFTP writers when you are doing a local operation: if they
didn't share locks, Bad Things would trivially happen.

Its because these locks are exposed in such a way that SFTP and FTP
access can take and release them that they persist.

I do agree that an automatic-break when:
 - the lock was obtained by this machine
 - the machine's uptime is less than the age of the lock

might be nice.

Martin Pool (mbp)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
tags: added: lockdir
Revision history for this message
Vincent Ladeuil (vila) wrote : Re: bzr locks persist across reboots

I encounter the same bug on babune from time to time.
Note that there is a separate bug about *not* throwing an error when limbo and pending_deletion are *empty* (bug #427773).

Martin Pool (mbp)
summary: - bzr locks persist across reboots
+ bzr should automatically break locks from dead processes on the local
+ machine
Changed in bzr:
importance: Low → Medium
Martin Packman (gz)
tags: added: affects-twisted
Revision history for this message
Martin Packman (gz) wrote :

This is done now under bug 220464 but disabled by default, the config option 'locks.steal_dead' needs setting to enable it.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.