[MERGE/RFC] no lock for 'is_shared'
Robert Collins
robertc at robertcollins.net
Fri Jul 25 10:33:47 BST 2008
On Mon, 2008-07-21 at 17:27 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> One of the things I noticed when tracing update, is that we end up
> reading the pack-names file twice. And I believe it is because
> 'is_shared' takes out an implicit write lock, which we then throw away.
>
> And we use 'is_shared()' because BzrDir.find_repository() needs to know
> whether it can use the containing repository or not. And it is done at
> an early enough stage that we aren't going to have the repository
> permanently locked yet. (It is done early enough that we don't even know
> if we want a read lock or a write lock.)
There is a bug here then: BzrDir.find_repository() should be using the
smart server methods which can perform the test on the server for
whether a repository can be used; we shouldn't be looking at is_shared
from the client.
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080725/66603bdd/attachment.pgp
More information about the bazaar
mailing list