sftp locks can get stuck
John Arbash Meinel
john at arbash-meinel.com
Wed Dec 21 01:56:43 GMT 2005
Robey Pointer wrote:
>
> On 19 Dec 2005, at 19:32, Robert Collins wrote:
>
>> regrettably I just ran into a situation with a
>> stale .bzr/branch-lock.write over sftp.
>>
>> Is there any mechanism we can use with sftp to ensure that we dont get
>> stale locks/can remove them as needed?
>>
>> (I.e. write a time stamp and nuke it after 24 hours?)
>
>
> There's of course a race in adding a timeout, but once you have a stale
> lock it may be unavoidable. :(
>
> There are some heuristics we could do to cut out some cases. For
> example, we could write the lock-owner's email address into the lock
> file, so that we could automatically recover from a stale lock that was
> just left behind by one of your own previous sessions. (It also helps
> you figure out who to ping if you're on a shared project and feeling
> conscientious.)
True. But as long as you don't forget you can push from more than one
machine, though you are likely to serialize your access. (This may
become more likely once we get bound branches, since there will be more
remote access going on).
>
> If all writes are transactional (are they?), then we could add a lock
> check phase right before the final commit: make sure that we still own
> the lock. Assuming the final commit is short, that would let us use a
> timeout of something much smaller, like 15 minutes. That would reduce
> the odds of needing to manually break a stale lock.
For now they are atomic, but not transactional. Meaning you can get out
of order. 2 pushes are modifying branch.py-*.weave, they each create a
temporary file, and then one wins.
And if they both modify branch.py and clone.py, one might win one, and
the other would win the other.
>
> Just free thoughts. I can't think of anything that would completely
> avoid the possibility of stale locks over a dumb transport.
>
> robey
>
Well, tla did it by using a double directory renaming structure. So if a
lock was broken, the directory would disappear, so the changes would
just disappear.
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/20051220/848d1fe5/attachment.pgp
More information about the bazaar
mailing list