Page MenuHomePhabricator

Implement connection timeout in MediaWiki's Http class
Closed, ResolvedPublic


Author: afeldman

MWHttpRequest currently sets CURLOPT_TIMEOUT ($this->curlOptions[CURLOPT_TIMEOUT] = $this->timeout;) but doesn't provide a way to set CURLOPT_CONNECTTIMEOUT_MS.

MWSearch as deployed in production has a 10 second timeout. Today we had an outage where lsearchd was up on servers but hung and apaches waited 10 seconds for the connection attempts to timeout. It would be better if search connection attempts timed out at 500-1000ms.

Version: 1.21.x
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:22 AM
bzimport set Reference to bz47027.
bzimport added a subscriber: Unknown Object (MLST).

Related URL: (Gerrit Change I6e64a8bfc58e899149463d305eac672c1e8ad2ba)

The maximum number of seconds to allow cURL functions to execute.

The maximum number of milliseconds to allow cURL functions to execute. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second.

Added in cURL 7.16.2. Available since PHP 5.2.3.

We already support CURLOPT_TIMEOUT. This is about supporting CURLOPT_CONNECTTIMEOUT_MS, which is what my patch does.

Related URL: (Gerrit Change I3e2a84ee8a759dd2bdb2fd0837e0cd5605541816) was merged ages ago.

Is more work needed here, or can this be closed?

No reply to comment 5. Assuming this bug is FIXED.
If that is not the case: Please reopen and elaborate what is left to do here to get this report fixed.