Page MenuHomePhabricator

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

Description

Author: afeldman

Description:
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

Details

Reference
bz47027

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: https://gerrit.wikimedia.org/r/58247 (Gerrit Change I6e64a8bfc58e899149463d305eac672c1e8ad2ba)

http://php.net/manual/en/function.curl-setopt.php

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

CURLOPT_TIMEOUT_MS
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: https://gerrit.wikimedia.org/r/67095 (Gerrit Change I3e2a84ee8a759dd2bdb2fd0837e0cd5605541816)

https://gerrit.wikimedia.org/r/#/c/67095/ 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.