[PING][MERGE] Waiting on locks

John Arbash Meinel john at arbash-meinel.com
Thu Aug 31 19:08:24 BST 2006


John Arbash Meinel wrote:
> Recently there was a discussion that we should actually try to wait on a
> remote lock, rather than immediately failing. I think Martin mentioned
> that it should already be doing that, but experience said otherwise, and
> looking closer, I can see why Martin might have thought that.
> 
> We have:
> 
> LockDir.attempt_lock() which actually attempts to lock the remote file,
> and fails otherwise.
> LockDir.wait_lock() Which will spin for a while, trying to obtain the
> lock every X seconds for Y total seconds before failing.
> and
> LockDir.lock_write() which is what the LockableFiles calls.
> 
> The documentation on lock_write says:
>     def lock_write(self):
>         """Wait for and acquire the lock."""
>         self.attempt_lock()
> 
> So I think it was intended that lock_write() would call
> 'self.wait_lock()' rather than calling 'self.attempt_lock()'.
> 
> However, the default lock timeout of 5 minutes seems a little bit long.

...

I haven't had any feedback on this, other than Robey's comment that the
default bzr timeout should be infinite. I'd probably be okay bumping it
back to 5 min, or something else on request.

But I'd also like a review so we can get some sort of waiting merged.

John
=:->


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


More information about the bazaar mailing list