From 82e0db11b3fc12ab07428ff4373e218f68043620 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 7 Aug 2009 11:01:15 +0000 Subject: [PATCH] Was occassionally failing due to race condition caused by mt_rand behaviour: cache/l10n_cache-en.cdb.tmp.1770228300 cache/l10n_cache-en.cdb.tmp.1770228300 --- maintenance/rebuildLocalisationCache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index a08efcabbc..ab6c2e6e09 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -66,7 +66,9 @@ class RebuildLocalisationCache extends Maintenance { $pid = ( $threads > 1 ) ? pcntl_fork() : -1; if ( $pid === 0 ) { - // Child + // Child, reseed because there is no bug in PHP: + // http://bugs.php.net/bug.php?id=42465 + mt_srand(getmypid()); $this->doRebuild( $codes, $numRebuilt, $lc, $force ); exit(); } elseif ($pid === -1) { -- 2.20.1