From: Niklas Laxström Date: Fri, 7 Aug 2009 11:01:15 +0000 (+0000) Subject: Was occassionally failing due to race condition caused by mt_rand behaviour: X-Git-Tag: 1.31.0-rc.0~40442 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=82e0db11b3fc12ab07428ff4373e218f68043620;p=lhc%2Fweb%2Fwiklou.git 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 --- 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) {