-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 error chunk creation in passthru #53506
Conversation
15a2106
to
f67e49c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to remove this wrapper I agree.
Can this be tested somehow?
By curiosity, did you spot why GET vs POST behave differently?
It should be possible with MockHttpClient, but looks like timeout mock responses are broken. Returning MockResponse with empty string generator responds with 200 status code and empty content. ErrorChunk seems to be lost somewhere and instead FirstChunk gets created. Later on due to error chunk destructor exception is being thrown.
POST method errors is not intended to be retried by the strategy.
With GET method is almost exactly the same, but on the last retry it explicitly wipes the passthru, therefore last retry does not have passthru callback and returns correct TimeoutException |
Got it thanks. |
@nicolas-grekas updated. Failing test doesn't seem to be related with my changes |
c8b1806
to
3e4a159
Compare
3e4a159
to
5e6d218
Compare
Thank you @rmikalkenas. |
Reverts symfony#53506
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [HttpClient] Make retry strategy work again | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53886 | License | MIT PR #53506 accidentally disabled the retry functionality. I reverted that PR and added a small test to make sure this does not happen again. Thank you `@ldebrouwer` for reporting this. FYI `@nicolas`-grekas `@rmikalkenas`, I will try to find an other solution to fix #52587. But I'll do that in a separate PR to get a quick merge on this one. Commits ------- 9a5797d [HttpClient] Make retry strategy work again
Timeout chunk should not be recreated as TransportException, because ErrorChunk losts information that it's timeout when passing thru.
Change solves issue mentioned at #52587