[MERGE] Commit updates sha-cache

Robert Collins robertc at robertcollins.net
Thu Sep 25 22:18:27 BST 2008


On Thu, 2008-09-25 at 12:05 -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Robert Collins wrote:
> > Refreshed for NEWS conflicts
> > 
> 
> +    * New race-free method on MutableTree ``get_file_with_stat`` for use
> +      when generating stat cache results. (Robert Collins)
> +
> 
> ^- I thought I should point out that 'get_file_with_stat' is not 100%
> race free. If someone is writing to the file while we are reading it,
> the stat value could give a different size than sum(map(len, lines))).
> 
> I think it is *less* racy than doing two calls, but I think it would be
> technically better to do the stat after we've finished reading, rather
> than before we start. (slightly different race, but the mtime will show
> up newer)
> 
> I'm not saying we have to do that to land this, but I thought I would
> bring up the discussion.

Well, if they do that, uhm. fugly. Perhaps we should os-write-lock the
file? But that has complications too.

I'm happy to tweak this further, as you're right. I don't have any good
suggestions though about clean apis for it that are not wasteful on
object counts.

-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/20080926/fed397cd/attachment-0001.pgp 


More information about the bazaar mailing list