[BUG] Pull command on Windows: we have 2 problems

John A Meinel john at arbash-meinel.com
Wed Oct 26 20:34:17 BST 2005


Alexander Belchenko wrote:
> Actually pull command fail on Windows because of deadlock.
> 
> For destination branch acquired write lock and later (when invoking
> merge_inner() for pulling actual file contents) make a try to acquire
> read lock for the same branch. On Windows as result we have deadlock
> situation and command fail when used msvcrt-based lock. But when user
> have pywin32 installed, then in deadlock situation bzr simply hang
> during call to win32file.LockFileEx().
> 
> Because I have pywin32 installed I have 2 bugs simultaneously and bzr hang.
> 
> Bug in pywin32-based implementation of win32-locking system I may fix.
> 
> But main bug with deadlock in pulling -- I can't.
> 
> If this problem does not occurs on Linux then Linux locking system
> probably have latent bug, I think. Or may be it is intended behaviour
> for Linux? But not for Windows as you can see.
> 
> I attach logs for pulling in both Windows variants (with pywin32 and
> without them). In pull-pywin32.log you can see additional debug info
> from locking/unlocking system.
> 
> Alexander
> 

I think the basic problem is that there are 2 branches that are being
grabbed. The merge code is creating its own Branch object, rather than
re-using the one used by "pull".

Here are possible fixes:

1) Change the merge interface to take a Branch object, instead of just a
path
2) Make sure the pull code has destroyed its Branch object before
calling merge (this is difficult, because I believe it wants to use it
afterwards, though it could always just grab it again).

I think the basic difference is that on Linux, if you already have a
write lock on a file, it silently ignores the request for a read lock.
At the very least on Linux you can upgrade a lock without unlocking and
re-locking the file. While on Windows, in order to change a lock status,
you must unlock, and then re-lock with the new status.

Probably Aaron should do the changes so that the merge is done using an
actual Branch object, rather than a path.
I know "merge.merge()" is designed for easy command line interpretation,
and there is a different function for internal bzr code. But I don't
remember the names off-hand.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051026/98b78564/attachment.pgp 


More information about the bazaar mailing list