sftp locks can get stuck

John Arbash Meinel john at arbash-meinel.com
Wed Jan 4 00:53:45 GMT 2006


Robert Collins wrote:
> On Tue, 2006-01-03 at 18:33 -0600, John Arbash Meinel wrote:
> 
>>Except FTP doesn't do any locking. As far as I know it doesn't even
>>support O_EXCL to lock the same way sftp does. 
> 
> 
> My point is that we have a writable FTP transport: locking should be
> figured out for it too. And that means we have 3 different sets of
> features that need locking to be interact.
> 
> directory renames anyone ?
> 
> Rob
> 

We certainly can do that. Is it sufficient to do something like:

# take lock
rename('lock', 'locked')
try:
  # do stuff
finally:
  rename('locked', 'lock')

The first rename would fail if the source didn't exist.

My understanding of why tla had to do the double-deep directory renaming
was because it wanted changes to disappear if the lock was broken.

I thought there was also some way of doing locks with hard links, but
that also wouldn't be terribly portable.

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/0234040c/attachment.pgp 


More information about the bazaar mailing list