empty lock info file causes crash in _parse_info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Martin Pool |
Bug Description
If Bazaar is interrupted at some points while taking a branch, it can leave behind an empty lock info file. The empty file causes a traceback when trying to do any other write operation on the branch, including trying to break the lock. We would probably get a similar failure if the lock info file is missing.
As a workaround, manually remove the 'held' directory inside the lock directory.
We should instead handle this as a special type of dead lock.
----
On a Bazaar Branch Format 6 (bzr 0.15) branch that has lock files, running bzr info -v produces the following:
bzr arguments: [u'info', u'-v']
looking for plugins in /home/mtaylor/
looking for plugins in /usr/lib/
Plugin name __init__ already loaded
Plugin name __init__ already loaded
encoding stdout as sys.stdout encoding 'UTF-8'
opening working tree '/home/
Traceback (most recent call last):
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
verbose=
File "/usr/lib/
outfile)
File "/usr/lib/
_show_
File "/usr/lib/
if (repository.
File "/usr/lib/
return self.control_
File "/usr/lib/
return self._lock.peek() is not None
File "/usr/lib/
info = self._read_
File "/usr/lib/
return self._parse_
File "/usr/lib/
return read_stanza(
AttributeError: 'NoneType' object has no attribute 'as_dict'
return code 4
Related branches
- John A Meinel: Approve
- Vincent Ladeuil: Approve
-
Diff: 114 lines (+44/-8)3 files modifiedNEWS (+5/-0)
bzrlib/lockdir.py (+19/-7)
bzrlib/tests/test_lockdir.py (+20/-1)
Changed in bzr: | |
status: | New → Confirmed |
Changed in bzr: | |
importance: | Wishlist → High |
assignee: | nobody → Martin Pool (mbp) |
summary: |
- empty lock info file gives traceback from bzr info and other operations + empty lock info file causes crash in _parse_info |
description: | updated |
tags: | added: lockdir |
Changed in bzr: | |
milestone: | none → 2.0.5 |
status: | In Progress → Fix Released |
Thanks for the report Monty
If you still have this branch, could you please save it.
I suspect that there is a lock/held/ directory that contains an empty, missing, or malformed file; if there is can you please post it to this bug?