sftp locks can get stuck
Robey Pointer
robey at lag.net
Fri Dec 23 22:11:12 GMT 2005
On 23 Dec 2005, at 5:59, John A Meinel wrote:
> Robey Pointer wrote:
>>
>> I think simpler is better here: We record tracking info in the write
>> lock (email, IP, timestamp) and provide a way to explicitly break the
>> lock. Maybe if an operation fails because of a write lock, and that
>> lock is pretty old (by some arbitrary standard), bzr could hint to
>> the
>> user:
>>
>> The branch was locked by <robey at lag.net> 5 hours ago.
>> If the lock is stale, you can break it with: bzr break-lock
>>
>> But no magic of trying to guess if the lock should be automatically
>> broken, etc. Stale locks should be relatively rare.
>
> I'm +1 for adding the username, and not automatically breaking the
> lock.
> I don't think the ip address helps much, but it is easy to record. I
> don't think we need the timestamp, because we can just stat() the lock
> file to figure out what time it was taken out. I suppose we could add
> the UCT timestamp to help with handling time-zone shift.
Exactly, yeah.
So probably what we should do is move the locking outward (to
Branch?) and have Transport just provide something like
create_lock_file(path, text_content)
and raise an exception if the lock file couldn't be created (via
O_EXCL or whatever the transport's equivalent is).
If that sounds okay I can probably cook up a patch.
robey
More information about the bazaar
mailing list