release status - land new features before monday

Robert Collins robertc at robertcollins.net
Thu Apr 12 03:33:41 BST 2007


On Thu, 2007-04-12 at 11:08 +1000, Martin Pool wrote:
> On 4/12/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> > At this point, locking 'dirstate' is more of future proofing, because we
> > eventually will try to read just portions of the file, rather than
> > always reading the whole thing. And that starts to get dicey if the file
> > might be changing underneath you.
> 
> Is it only future proofing?  I mean, would there be any problems with
> two processes running the current code if there are no read locks?

Yes. We rewrite the file in place (no atomic replacement on windows), so
a anonymous reader can read an inconsistent file. We *had* bugs with
that before we added the read lock.

> The read lock has some other undesirable effects, like not being able
> to diff while a commit is pending.
> 
> > So we could just make it so that on win98 we:
> >
> > 1) Don't lock for reading
> > 2) Always read the whole file (disable partial reads).

It can still race I believe. In particular you can read less than a full
file if the writer shrinks the file.

> It would still be possible for a fast writer to update the whole file
> while the reader is partway through it, so it's not quite safe, at
> least in theory.

Definately, I've seen this happen.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070412/3b051c1e/attachment.pgp 


More information about the bazaar mailing list