Mercurial > hg
diff tests/test-remotefilelog-repack-fast.t @ 42943:5fadf6103790
remotefilelog: replace repack lock to solve race condition
2c74337e6483 reduced the probability of race-conditions when starting
background repack and prefetch and we saw the difference in our CI instance
with all failures disappearing except one where one call to waitonrepack seems
to returns too early.
I'm not sure what exactly goes wrong but I realized that while the prefetch
operation uses a standard Mercurial lock, the repack operation is using a
custom lock based on `fcntl.flock` on available platforms. As `extutil.flock`
fallback on traditional Mercurial locks on other platforms and the tests are
stable on my laptop, our CI environment and GCC112, I'm sending this patch to
standardize the behavior across environments.
Differential Revision: https://phab.mercurial-scm.org/D6844
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 11 Sep 2019 17:41:13 +0200 |
parents | 2c74337e6483 |
children | 88ab1295db4c |
line wrap: on
line diff
--- a/tests/test-remotefilelog-repack-fast.t Tue Sep 17 18:36:30 2019 +0200 +++ b/tests/test-remotefilelog-repack-fast.t Wed Sep 11 17:41:13 2019 +0200 @@ -56,7 +56,6 @@ $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos # Test that the packs are readonly @@ -65,7 +64,6 @@ -r--r--r-- 172 1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack -r--r--r-- 1074 b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx -r--r--r-- 72 b1e0cfc7f345e408a7825e3081501959488d59ce.datapack - -rw-r--r-- 0 repacklock # Test that the data in the new packs is accessible $ hg cat -r . x @@ -89,7 +87,6 @@ $TESTTMP/hgcache/master/packs/1e91b207daf5d7b48f1be9c587d6b5ae654ce78c.histpack $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.dataidx $TESTTMP/hgcache/master/packs/b1e0cfc7f345e408a7825e3081501959488d59ce.datapack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos $ hg repack --traceback @@ -99,7 +96,6 @@ $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos # Verify all the file data is still available @@ -119,7 +115,6 @@ $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos # Run two repacks at once @@ -143,7 +138,6 @@ $TESTTMP/hgcache/master/packs/78840d69389c7404327f7477e3931c89945c37d1.datapack $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histidx $TESTTMP/hgcache/master/packs/8abe7889aae389337d12ebe6085d4ee13854c7c9.histpack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos $ hg repack --background @@ -155,7 +149,6 @@ $TESTTMP/hgcache/master/packs/39443fa1064182e93d968b5cba292eb5283260d0.datapack $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histidx $TESTTMP/hgcache/master/packs/604552d403a1381749faf656feca0ca265a6d52c.histpack - $TESTTMP/hgcache/master/packs/repacklock $TESTTMP/hgcache/repos # Test debug commands @@ -232,7 +225,6 @@ bfd60adb76018bb952e27cd23fc151bf94865d7d.histpack fb3aa57b22789ebcc45706c352e2d6af099c5816.dataidx fb3aa57b22789ebcc45706c352e2d6af099c5816.datapack - repacklock $ hg debughistorypack $TESTTMP/hgcache/master/packs/*.histidx x