other forms of LockDir: changing instantiation
John Arbash Meinel
john at arbash-meinel.com
Sat Oct 28 00:21:57 BST 2006
Scott Parish wrote:
> I'm working on a new transport for use with bzr (amazon's s3) which
> doesn't have an atomic rename--i'm going to have to make a new
> implementation of LockDir. Unfortunately there's no good way to
> plug-in new versions of LockDir.
>
> Right now LockDir is instantiated like:
>
> lockdir.LockDir(transport, name, file_modebits=, dir_modebits=)
>
> My proposal is to change this to:
>
> transport.get_lockdir(name, file_modebits=, dir_modebits=)
>
> thus allowing the individual transport to choose which LockDir
> implementation(s) they support.
>
> Any thoughts?
>
> Thanks
> sRp
Well, if you don't have atomic rename, then some other pieces also won't
really work. (We expect it for certain other operations).
What specifically does/doesn't work for Amazon's S3?
For LockDir, we expect that renaming over a directory with content will
fail if it already exists. But in other places we expect that we *can*
rename a file over another one and have it succeed.
It would be possible to change LockDir into being a factory of
Transport, but we did that in the past for plain lock files, and it
really isn't a great way to go.
I realize for Amazon S3, it isn't likely that someone would access it
under any other protocol, so it might be okay (unlike sftp versus ftp
versus webdav versus local where they all can access the same physical
files).
Anyway, if you can give some more hints as to your problems, we can
probably give you some pointers as to what we can do.
I'm okay with your proposal, but it might encourage bad usage elsewhere,
when we expect the locking mechanisms to be the same.
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/20061027/95bc52a7/attachment.pgp
More information about the bazaar
mailing list