Commit c837441c authored by Björn Häuser's avatar Björn Häuser

usleep after curl_multi_select -1

According to these php bugs:

* https://bugs.php.net/bug.php?id=61141
* https://bugs.php.net/bug.php?id=63842

thats what we should do.

I came across this issue when trying to make the ParallelExecution
working on my CentOS 7.3 box. It spinlooped inside the changed loop.

Also guzzle is doing the same thing:

https://github.com/guzzle/guzzle/blob/master/src/Handler/CurlMultiHandler.php#L103

I am not sure if the timeout needs to be configurable and if the choosen
value (100) is good.
parent 0acdb283
......@@ -156,12 +156,14 @@ class ParallelExecution extends AbstractPlugin
$timeout = $this->getOption('curlmultiselecttimeout');
while ($active && $mrc == CURLM_OK) {
if (curl_multi_select($multiHandle, $timeout) != -1) {
if (curl_multi_select($multiHandle, $timeout) == -1) {
usleep(100);
}
do {
$mrc = curl_multi_exec($multiHandle, $active);
} while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
$this->client->getEventDispatcher()->dispatch(Events::EXECUTE_END, new ExecuteEndEvent());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment