cannot break dirstate lock

Bug #298124 reported by Matthias Müller-Reineke
2
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

I want to break a stale lock which was left by an interrupted uncommit:

sh-3.2$ bzr break-lock
bzr: ERROR: Could not acquire lock "LockDir(file:///C:/home/mueller/WinXP/.bzr/branch/lock)"

Bzr didn't terminate after several minutes.
The branch is a checkout of a branch on a Samba share. That branch was created with bzr 0.17 on Linux. My Windows bzr 1.8 hints me at upgrading (but I don't because it should stay usable with bzr 0.17).

$ bzr --version
Bazaar (bzr) 1.8
  Python interpreter: C:\Python25\python.exe 2.5.2
  Python standard library: C:\Python25\lib
  bzrlib: C:\Python25\lib\site-packages\bzrlib
  Bazaar configuration: C:\Dokumente und Einstellungen\mueller\Anwendungsdaten\bazaar\2.0
  Bazaar log file: \\gvfile\Müller-Reineke$\.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

$

The tracebacks look like this:

0.109 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.109 bzr arguments: [u'break-lock']
0.109 looking for plugins in C:/Dokumente und Einstellungen/mueller/Anwendungsdaten/bazaar/2.0/plugins
0.109 looking for plugins in C:\Python25\lib\site-packages\bzrlib\plugins
0.109 Plugin name __init__ already loaded
0.109 Plugin name __init__ already loaded
0.531 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.718 opening working tree 'C:/home/mueller/WinXP'
0.750 Traceback (most recent call last):
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 849, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 795, in run_bzr
    ret = run(*run_argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 495, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\Python25\lib\site-packages\bzrlib\builtins.py", line 3855, in run
    control.break_lock()
  File "C:\Python25\lib\site-packages\bzrlib\bzrdir.py", line 115, in break_lock
    thing_to_unlock.break_lock()
  File "C:\Python25\lib\site-packages\bzrlib\workingtree_4.py", line 213, in break_lock
    raise errors.LockActive(self.basedir)
LockActive: The lock for 'C:/home/mueller/WinXP' is in use and cannot be broken.

0.750 return code 3

0.110 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.125 bzr arguments: [u'break-lock']
0.125 looking for plugins in C:/Dokumente und Einstellungen/mueller/Anwendungsdaten/bazaar/2.0/plugins
0.125 looking for plugins in C:\Python25\lib\site-packages\bzrlib\plugins
0.125 Plugin name __init__ already loaded
0.125 Plugin name __init__ already loaded
0.547 encoding stdout as osutils.get_user_encoding() 'cp1252'
0.719 opening working tree 'C:/home/mueller/WinXP'
0.750 Traceback (most recent call last):
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 849, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 795, in run_bzr
    ret = run(*run_argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 495, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\Python25\lib\site-packages\bzrlib\builtins.py", line 3855, in run
    control.break_lock()
  File "C:\Python25\lib\site-packages\bzrlib\bzrdir.py", line 115, in break_lock
    thing_to_unlock.break_lock()
  File "C:\Python25\lib\site-packages\bzrlib\workingtree_4.py", line 213, in break_lock
    raise errors.LockActive(self.basedir)
LockActive: The lock for 'C:/home/mueller/WinXP' is in use and cannot be broken.

0.766 return code 3
300.484 Traceback (most recent call last):
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 849, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 795, in run_bzr
    ret = run(*run_argv)
  File "C:\Python25\lib\site-packages\bzrlib\commands.py", line 495, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\Python25\lib\site-packages\bzrlib\builtins.py", line 1049, in run
    tree.lock_write()
  File "C:\Python25\lib\site-packages\bzrlib\workingtree_4.py", line 641, in lock_write
    self.branch.lock_write()
  File "C:\Python25\lib\site-packages\bzrlib\branch.py", line 1505, in lock_write
    token = self.control_files.lock_write(token=token)
  File "C:\Python25\lib\site-packages\bzrlib\lockable_files.py", line 258, in lock_write
    token_from_lock = self._lock.lock_write(token=token)
  File "C:\Python25\lib\site-packages\bzrlib\lockdir.py", line 576, in lock_write
    return self.wait_lock()
  File "C:\Python25\lib\site-packages\bzrlib\lockdir.py", line 544, in wait_lock
    raise LockContention(self)
LockContention: Could not acquire lock "LockDir(file:///C:/home/mueller/WinXP/.bzr/branch/lock)"

Tags: win32
Revision history for this message
Matthias Müller-Reineke (matthias-mueller-reineke) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

It's not possible for us to break the OS lock we use for the dirstate file at the moment - you need to find the bzr process that's still using it and quit or terminate it. Eventually we will fix that, as part of bug 98836.

It might be possible for us to break the lock on only the branch, not the dirstate, but that may cause trouble if the process is still running and expects the lock to exist.

description: updated
summary: - break-lock complains about lock
+ cannot break dirstate lock
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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