Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Potential regression around timeouts and retry strategy in 7.0.3. #53886

Copy link
Copy link
Closed
@ldebrouwer

Description

@ldebrouwer
Issue body actions

Symfony version(s) affected

7.0.3

Description

I currently make extensive use of the Async AWS project across varying platforms, and ever since I've upgraded symfony/http-client from version 7.0.2 to 7.0.3 I've seen an influx of issues that I believe were handled accordingly previously, or at least gracefully retried.

I believe that #53506 may have inadvertently caused a regression, or caused unintended side-effects elsewhere in the package.

In terms of real world effects this means I see around 25 exceptions being thrown per 4 million requests, where I previously saw none. It's not a lot, but it's there, and it's noisy.

Please find a snippet of a stack trace below;

        "class": "Symfony\\Component\\HttpClient\\Exception\\TimeoutException",
        "message": "Idle timeout reached for \"https://sts.eu-west-1.amazonaws.com/\".",
        "code": 0,
        "file": "/var/www/html/vendor/symfony/http-client/Chunk/ErrorChunk.php:56",
        "trace": [
          "/var/www/html/vendor/symfony/http-client/Response/AsyncResponse.php:70",
          "/var/www/html/vendor/symfony/http-client/Response/CommonResponseTrait.php:144",
          "/var/www/html/vendor/symfony/http-client/Response/AsyncResponse.php:97",
          "/var/www/html/vendor/async-aws/core/src/Response.php:147",
          "/var/www/html/vendor/async-aws/core/src/Result.php:69",
          "/var/www/html/vendor/async-aws/core/src/Result.php:137",
          "/var/www/html/vendor/async-aws/core/src/Sts/Result/AssumeRoleWithWebIdentityResponse.php:112",
          "/var/www/html/vendor/async-aws/core/src/Credentials/WebIdentityProvider.php:116",
          "/var/www/html/vendor/async-aws/core/src/Credentials/WebIdentityProvider.php:53",
          "/var/www/html/vendor/async-aws/core/src/Credentials/ChainProvider.php:54",
          "/var/www/html/vendor/async-aws/core/src/Credentials/CacheProvider.php:38",
          "/var/www/html/vendor/async-aws/core/src/AbstractApi.php:146",
          "/var/www/html/vendor/async-aws/sqs/src/SqsClient.php:722",

Apologies for truncation of the stack trace, but this should give some insight.

In the example above you see that an idle timeout was reached for https://sts.eu-west-1.amazonaws.com/. It's not like I've got a super restrictive timeout configured for the HttpClient, as a matter of fact, even bumping it to 30 seconds didn't alleviate this issue.

Reverting back to 7.0.2 completely made this issue go away. I'm seeing no failed requests (due to incorrect STS credentials), which I believe is due to the fact that the HttpClient retries idle timeouts accordingly up until 7.0.2.

Of course I could try and handle this by creating a custom credential provider that I'd use with the AsyncAWS packages, but that would kind of defeat the purpose of using the RetryableHttpClient in conjunction with a retry strategy.

How to reproduce

This is nigh impossible to reproduce. As I mentioned, I'm only seeing a handful of exceptions over millions of requests, which makes it incredibly hard to pin down.

Possible Solution

I would suggest temporarily reverting #53506, and seeing which side-effects these changes have in the larger ecosystem of the package. It's clear that an exception now bubbles up, which was retried gracefully previously.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.