From: Erik Bernhardson Date: Tue, 25 Mar 2014 22:31:56 +0000 (-0700) Subject: Reduce connect timeout in MediaWiki::triggerJobs X-Git-Tag: 1.31.0-rc.0~16501^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=6f65ab9a22881c73ce9f7b6b7cf54445e80fdb55;p=lhc%2Fweb%2Fwiklou.git Reduce connect timeout in MediaWiki::triggerJobs The fifth parameter to fsockopen is the number of seconds to wait before declaring the connection a failure. When not provided it defaults to the php ini value of 'default_socket_timeout' which is 60s. Under no circumstances should we wait 60s to connect to ourselves, 100ms seems like a reasonable timeout since its explicitly connecting to itself, but the exact timeout could be slightly longer. Change-Id: I18d328274ddf1e0848fce40ebf39e0466b5c4d5d --- diff --git a/includes/Wiki.php b/includes/Wiki.php index 4bf8fd3a59..6cf718c5bc 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -655,7 +655,10 @@ class MediaWiki { $info['host'], isset( $info['port'] ) ? $info['port'] : 80, $errno, - $errstr + $errstr, + // If it takes more than 100ms to connect to ourselves there + // is a problem elsewhere. + 0.1 ); wfRestoreWarnings(); if ( !$sock ) {