-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected
5.3.13
Description
I have default_socket_timeout
set to -1
(which is supposed to mean some big timeout). I noticed a bug, which appears when I'm trying to stream response: I have "Idle timeout reached" error.
How to reproduce
$response = $httpClient->request('GET', 'https://example.org');
$stream = $response->toStream();
which gets us the next call chain
public function toStream(bool $throw = true) $this->getHeaders($throw); public function getHeaders(bool $throw = true): array self::initialize($this); private static function initialize(self $response): void foreach (self::stream([$response], -0.0) as $chunk) { public static function stream(iterable $responses, float $timeout = null): \Generator $multi->handlesActivity[$j] = [new ErrorChunk($response->offset, sprintf('Idle timeout reached for "%s".', $response->getInfo('url')))];
where at the last point $timeoutMax
equals 0
, so any elapsed time will exceed this value.
Possible Solution
$timeoutMax
value should be set to some big number instead of zero.