lock-breaking ui

Martin Pool mbp at sourcefrog.net
Sun Feb 26 22:40:33 GMT 2006


On 26 Feb 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> James Blackwell wrote:
> Well, under the proposed LockDir design, you check the lock when you
> unlock it. (You rename the locked directory out of the way to get an
> atomic unlock, and then you can inspect it to make sure it was yours).
> 
> It certainly is possible to check (because you can read lock/details.txt
> and see if the nonce matches your nonce).
> 
> It just depends how we actually want to do it.

The current code does check it and will raise an exception from the
unlock method if it was broken under you.  Of course at that point
there's not much we can do but notify the next of kin -- as discussed
earlier in this thread the whole point of having locks is that you can
rely on not having coliding reads.  Of course the data format can try to
be robust or recoverable from this but it's a different issue.

-- 
Martin




More information about the bazaar mailing list