Comment 3 for bug 523557

Revision history for this message
Parth Malwankar (parthm) wrote :

This is still happening with bzr 2.1. Interestingly it happens only with 'bzr info -v lp:loggerhead/1.17'. Without the -v and on a few other repos (I tried bzr/2.0, bzr-grep) it doesn't happen.

The LockNotHeld exception is caused during the unlock which is odd since the lock is actually held show_bzrdir_info

Source: bzrlib.info.show_bzrdir_info:
=============================
    .....
    lockable.lock_read()
    try:
        show_component_info(a_bzrdir, repository, branch, tree, verbose,
                            outfile)
    finally:
        lockable.unlock()

Log
===
[~]% bzr info -v lp:loggerhead/1.17
Repository branch (format: unnamed)
Location:
  shared repository: bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/
  repository branch: bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/

Related branches:
  stacked on: /~loggerhead-team/loggerhead/trunk-rich

Format:
       control: bzr remote bzrdir
        branch: Remote: Branch format 7
    repository: Remote: Packs 6 rich-root (uses btree indexes, requires bzr 1.9)
bzr: ERROR: Lock not held: LockableFiles(lock, bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/.bzr/repository/)
[~]% bzr info lp:loggerhead/1.17
Repository branch (format: unnamed)
Location:
  shared repository: bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/
  repository branch: bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/

Related branches:
  stacked on: /~loggerhead-team/loggerhead/trunk-rich
[~]%

Stack Trace
==========
  File "/usr/lib/python2.6/dist-packages/bzrlib/info.py", line 354, in show_bzrdir_info
    lockable.unlock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 2446, in unlock
    self.repository.unlock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/remote.py", line 1128, in unlock
    self._real_repository.unlock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/pack_repo.py", line 2422, in unlock
    self.control_files.unlock()
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 222, in wrapped
    return unbound(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/lockable_files.py", line 226, in unlock
    return lock.cant_unlock_not_held(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/lock.py", line 105, in cant_unlock_not_held
    raise errors.LockNotHeld(locked_object)
LockNotHeld: Lock not held: LockableFiles(lock, bzr+ssh://bazaar.launchpad.net/~loggerhead-team/loggerhead/1.17/.bzr/repository/)