-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Parameterize list of retryable methods #38426
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
Conversation
I wonder if the implementation/configuration shouldn't be more complicated:
Maybe:
|
68a37b1
to
070c1be
Compare
src/Symfony/Component/HttpClient/Retry/HttpStatusCodeDecider.php
Outdated
Show resolved
Hide resolved
2d35c26
to
e40e360
Compare
failling test are related to Could not parse version constraint >=5.x: Invalid version string "5.x" And related to async-aws that should be fixed by async-aws/aws#802 |
f6270bb
to
73db919
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.
Thank you. I like this. I added a bunch of questions for things I dont understand.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpClient/Retry/HttpStatusCodeDecider.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpClient/Retry/HttpStatusCodeDecider.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpClient/Retry/HttpStatusCodeDecider.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpClient/Retry/RetryDeciderInterface.php
Outdated
Show resolved
Hide resolved
3f9fb7a
to
a7f7ec5
Compare
src/Symfony/Component/HttpClient/Retry/HttpStatusCodeDecider.php
Outdated
Show resolved
Hide resolved
Let's settle on #38532 before merging (and rebasing) this one. |
ab67ad5
to
434d5a3
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.
for exceptions, we could use the status code 0
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Outdated
Show resolved
Hide resolved
434d5a3
to
f84e00c
Compare
2c1ee99
to
83d8d10
Compare
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpClient/Retry/GenericRetryStrategy.php
Outdated
Show resolved
Hide resolved
83d8d10
to
56809d1
Compare
Thank you @jderusse. |
Retrying non-idempotent methods is not always acceptable for user. This PR adds an easy way to configure this behavior.
The
RetryDeciderInterface::shouldRetry()
now take the exception in parameter, in order to let decider not retrying the request when the methods should never by retried.With #38420, this code would belongs to the RetryStrategy implementation, and would return an
NeverRetryDecider
when method is not allowed.