Skip to content

Setting up concurrent queries but not retrieving data causes HttpClient timeout #4

@simonrjones

Description

@simonrjones

To replicate:

  • Setup QueryManager by adding one query
  • Do not actually retrieve data

If this is run within a test, then Symfony HttpClient pauses for 30 seconds and times out in the destruct process. It looks like concurrent queries actually partly run when added & then cause an error in destruct if data is not retrieved.

This causes an issue in a Symfony app where a Query Manager has some default queries (e.g. primary navigation) but some controllers do not retrieve any data (e.g. endpoint to return static data). This has the effect of a fatal error after 30 seconds of the page response being sent to the browser.

Replicate in w3c-website-frontend via: ./vendor/bin/phpunit tests/Controller/JsonControllerTest.php

Fatal error: Uncaught Symfony\Component\HttpClient\Exception\TimeoutException: Idle timeout reached for "https://cms-dev.w3.org/api/". in /Users/sjones/Sites/w3c/w3c-website-frontend/vendor/symfony/http-client/Chunk/ErrorChunk.php:65
Stack trace:
#0 /Users/sjones/Sites/w3c/w3c-website-frontend/vendor/symfony/http-client/Response/CommonResponseTrait.php(157): Symfony\Component\HttpClient\Chunk\ErrorChunk->isFirst()
#1 /Users/sjones/Sites/w3c/w3c-website-frontend/vendor/symfony/http-client/Response/TransportResponseTrait.php(141): Symfony\Component\HttpClient\Response\CurlResponse::initialize(Object(Symfony\Component\HttpClient\Response\CurlResponse), -0)
#2 /Users/sjones/Sites/w3c/w3c-website-frontend/vendor/symfony/http-client/Response/CurlResponse.php(255): Symfony\Component\HttpClient\Response\CurlResponse->doDestruct()
#3 [internal function]: Symfony\Component\HttpClient\Response\CurlResponse->__destruct()
#4 {main}
  thrown in /Users/sjones/Sites/w3c/w3c-website-frontend/vendor/symfony/http-client/Chunk/ErrorChunk.php on line 65

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions