[Critical] dirstate format use OS file locking

Martin Pool martinpool at gmail.com
Thu Mar 8 05:39:21 GMT 2007


On 08/03/07, Alexander Belchenko <bialix at ukr.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm track down problem with LockError.
>
> Dirstate working tree format use old bzr locking mechanism (lock.py) based on underlying OS locks.
> This was used in the past. But it NEVER works correctly on win32 in some cases
> (especially 'bzr pull .' cause deadlock on win32 and cygwin).
>
> Now we have absolutely the same: on win32: after bzr obtain write lock it *cannot* obtain read lock
> on the same file. IIRC, in the end of 2005 year there was discussion about this limitation, and
> after this bzr switch to use lock-dirs.

There were other reasons too, primarily that os locks can't be seen
over network protocols.

Read locks are needed for dirstate because it can be updated in place,
and isn't safe to read while that is happening.

If the locking problems are insoluble we could potentially go back to
always replacing the whole thing.

> Now bzr reverts to old [buggy] behaviour.
> For me this means that 0.15rc1 in current state is unusable on win32.
> I don't know what to say more.

"We need to fix this before 0.15 final" :-)

We should fix it so that we do not try to take a read lock if we have
a write lock.  I'm surprised we do; it's just a bug i think, not a
design problem.

-- 
Martin



More information about the bazaar mailing list