[MERGE] Change DirStateRevisionTree
John Arbash Meinel
john at arbash-meinel.com
Fri Jan 23 21:34:25 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> 2009/1/23 John Arbash Meinel <john at arbash-meinel.com>:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> So, as many have encountered, we've had some problems with OS locks on
>> win32. This happens because on Linux, the same process can lock a file
>> multiple times, without having problems, but not on win32. (I've
>> mentioned this before, but I'm summarizing to remind people what is
>> going on.)
>>
>> I believe I've tracked down the primary cause of this:
>>
>> WorkingTree.basis_tree()
>>
>> The issue is that for dirstate formats, it returns a
>> DirStateRevisionTree that grabs direct access to the
>> '.bzr/checkout/dirstate' file.
>
> BB: approve
>
> That was nicely done: the reasoning makes sense and the patch seems to
> correctly implement it. You might want to look up the relevant bug
> and put it in NEWS and mark it fixed or ask for confirmation.
>
>> Anyway, with this patch, I would imagine most of the win32 failures
>> about LockContention will go away. I don't really like fixing it by
>> allowing programmers to be sloppy, but we've had 6months => 1year of
>> this problem, and nothing has actually happened.
>>
>> I also added code to give DeprecationWarnings for callers that do
>> naughty things. However, as I don't want to spend the time fixing them
>> right now, I just commented out the warning.
>
> Personally I think we should change the wt format so as not to rely on
> shared/exclusive locks, as they cause several problems that cannot be
> easily fixed in code: on filesystems with no locks (eg AFS), when
> running guis and other command simultaneously, and of course that
> we're using a facility that's so different on Windows and Unix. I
> don't know if we'll get to that soon, but I think working towards it
> is better than updating the callers for something we want to get rid
> of.
>
Well, we still would want callers to hang on to their lock for the whole
time. Right now, unlocking & locking a WT causes us to re-parse the
entire dirstate file. Not terribly slow, but a bit silly to do multiple
times.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkl6N+EACgkQJdeBCYSNAAM3bACePeEsCtV7F8p2kTCwew/0myMR
rlQAn1CLPziYUDtj6HH5rN2TXGSfea9u
=eLsj
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list