[1.5 critical] Branch.lock() does not set RemoteRepository.is_locked() == True
John Arbash Meinel
john at arbash-meinel.com
Fri May 9 18:01:39 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
| I'm investigating this now, but I just ran into a *really* weird bug.
| Basically
| if you do:
|
| |>> b = bzrlib.branch.Branch.open('bzr+ssh://....')
| |>> b.lock_read()
| |>> print b.is_locked(), b.repository.is_locked()
| True, False
|
| I'm trying to track down why, but it seems to be causing some
| performance issues
| with remote operations that are using get_parent_map(). Because if the
| remote
| repo doesn't think it is locked, it will not cache any of the requests. And
| other stuff just plain breaks (bzr log --short bzr+ssh://, fails during
| iter_reverse_revision_history() because it thinks the repo isn't locked.)
|
|
| I'm not going to put out 1.5rc1 unless I can fix this, so stay tuned.
|
| John
| =:->
So the specific bug seems to be that RemoteBranch.lock_read() does not call
self.repository.lock_read()
I think it works occasionally if self._real_branch is set, because
self._real_branch.repository = self.repository
is set in RemoteBranch._ensure_real(), and in lock_read() if self._real_branch
is not None, then it calls self._real_branch.lock_read().
So I'm 90% sure that this is a real bug that needs to be fixed. But I'm not sure
that it is a regression as such.
I'm also uncomfortable creating a patch for this area, as I'm not sure how the
lock_read() calls are supposed to be stacking. (because we are setting
_real_branch.repository, if _real_branch exists, then this will cause multiple
lock_read() calls on RemoteRepository, etc.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkgkg3MACgkQJdeBCYSNAANoFQCgiFyb1DNP2dNDhAB4H7CcNAnN
TmQAn3v+6uRvkEBz5W/noSQaUDShk99V
=wlCj
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list