You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like Symfony's RetryableHttpClient messes up exceptions in case of a timeout.
As showed at the reproducer if request is sent using "GET" method, client throws TimeoutException - which is correct.
But as soon as you change "GET" with "POST", exception class changes to TransportException, even though both exceptions messages are same.
If such behaviour is expected - then how to correctly identify a timeout without weirdly parsing and matching exception message?
Reproduced with php 8.2 and symfony 6.3.8
cc @jderusse maybe you will have some insights, since retryable client is written by you
…enas)
This PR was merged into the 5.4 branch.
Discussion
----------
[HttpClient] Fix error chunk creation in passthru
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | #52587
| License | MIT
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
Commits
-------
5e6d218 [HttpClient] Fix error chunk creation in passthru
I'm reopening, but in the light of #53889, I must say that this might be the expected behavior: timeouts thrown while requesting the status code or headers are not regular timeouts. They're unrecoverable transport errors. Semantically, timeout exceptions are meant to signal a recoverable transport error (one might just need to be more patient to get some activity back and thus recover from the timeout).
About GET vs POST behavior, this might also be the desired behavior: when a timeout is thrown, the remote server might still have processed the request, so that retrying might not be safe.
Of course, if the timeout happens before we sent the headers on our side, then we can safely retry, but we don't have this level of accuracy in the client. Maybe we could detect the situation by leveraging some "info" returned by curl and leverage this in RetryableHttpClient.
If that'd help, AsyncResponse could add the TimeoutException as the "previous" exception of TransportException.
Symfony version(s) affected
6.3.8
Description
Looks like Symfony's RetryableHttpClient messes up exceptions in case of a timeout.
As showed at the reproducer if request is sent using "GET" method, client throws TimeoutException - which is correct.
But as soon as you change "GET" with "POST", exception class changes to TransportException, even though both exceptions messages are same.
If such behaviour is expected - then how to correctly identify a timeout without weirdly parsing and matching exception message?
Reproduced with php 8.2 and symfony 6.3.8
cc @jderusse maybe you will have some insights, since retryable client is written by you
How to reproduce
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: