sftp locks can get stuck

John Arbash Meinel john at arbash-meinel.com
Tue Jan 3 19:03:26 GMT 2006


Robey Pointer wrote:
> Sorry I didn't reply to this earlier.  My mailbox grew out of my 
> control over the holidays.
> 

Understandable.

> 
> On 24 Dec 2005, at 11:29, John A Meinel wrote:
> 
>> Robey Pointer wrote:
>>
>>> On 23 Dec 2005, at 5:59, John A Meinel wrote:
>>>

...

>> The question is how do we really want to do this. Do we want to  give
>> up the auto-unlock properties of OS locks, because of SFTP. Or  do we
>> just want SFTPTransport to add extra information to the lock.
> 
> 
> I think it would be good to have all transports using the same lock.  
> So that if someone is accessing a branch via HTTP and someone else  via
> SFTP, they still don't trample over each other.

Well, we are also designing the system, such that a read lock is a
no-op. Since you can't write anything anyway with http, this already
happens. :)
The only problem is local versus sftp at this moment.

> 
> Whether we want to support concurrent local & remote access is a 
> debatable question.  I'm leaning toward "yes".
> 
> 
>> If we are okay playing the least-common-denominator game, then I 
>> would say we change the Transport.lock_write() call, so that it  asks
>> for a text_content string, and then LocalTransport will act  like
>> SFTPTransport and create an O_EXCL file, and fill it with the  content.
> 
> 
> Yeah what I would suggest is even to abstract it further and have the 
> filename provided, too, so that handling where the lockfile is  created
> is part of Storage or higher.
> 
> robey
> 
> 

Well, at this point, we are locking a particular file (specifically
.bzr/branch-lock).

We could change the setup so that .bzr/branch-lock only exists when the
lock is held, rather than the current situation where it always exists,
and it is an OS lock which means the branch is locked or not.

One other semi-advantage of an OS lock, is that another user can block
until the first one is done. So that if I run 'bzr check' in one window,
and "bzr commit -m 'fixed'" in another one, the commit will wait for
check to finish, and then commit. With sftp style locks, when we can't
create the lock we just raise an exception. (I suppose we could poll
waiting for the lock to go away).

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060103/42cadb1d/attachment.pgp 


More information about the bazaar mailing list