[MERGE/RFC] no lock for 'is_shared'
ian.clatworthy at canonical.com
Fri Jul 25 08:46:22 BST 2008
John Arbash Meinel wrote:
> 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.)
> So here is a possible patch:
Can you post this as an attachment so BB can track it correctly?
> It just removes the implicit lock. We aren't saving the value anyway, so
> I don't think locking buys us anything but a round trip to read
> something we aren't going to cache.
More information about the bazaar