Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpClient] Fix handling timeouts when responses are destructed #42896

Merged
merged 1 commit into from Sep 7, 2021

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Spotted while giving a workshop on HttpClient at WebSummerCamp:

When responses are destructed, the timeout is counted from the call to the destructor. This means that when 10 concurrent requests are destructed and they all timeout, the code waits for 10 * $timeout before giving back control.

This PR fixes it by counting the timeouts from the first timeout when they happen in chain on destruction.

@carsonbot carsonbot added this to the 4.4 milestone Sep 6, 2021
@nicolas-grekas nicolas-grekas changed the title [Translation] Add missing Romanian translations [HttpClient] Fix handling timeouts when responses are destructed Sep 6, 2021
@nicolas-grekas
Copy link
Member Author

Merge conflicts with 5.3 should be solved using #42894

@carsonbot
Copy link

Hey!

I think @Toflar has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas merged commit 6645885 into symfony:4.4 Sep 7, 2021
@nicolas-grekas nicolas-grekas deleted the hc-timeout44 branch September 7, 2021 07:17
This was referenced Sep 28, 2021
nicolas-grekas added a commit that referenced this pull request Dec 11, 2021
… requests (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Don't reset timeout counter when initializing requests

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #44544
| License       | MIT
| Doc PR        | -

Same as #42896 but on initialize.

Commits
-------

8f3bdeb [HttpClient] Don't reset timeout counter when initializing requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants