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
Add support for retries if request fails #708
Comments
I didn't implemented retry at first because thought that AWS was stable enough for not needing that. But if you encounter too many error, and are impacted but that, it can worth it. moreover Symfony provides primitive to do it in a clean way.. Ready for a PR? |
Yes, but every service MAY down.
Do you mean making use of the new
Sorry if what I said made no sense...haha |
When those errors occurred, I swapped the CurlHttpClient with NativeHttpClient, because I wanted to check if that made a difference. It did not. Yesterday I swapped it back, and did not receive any errors since. I will keep monitoring.
TBH, I will not have time in the coming days/weeks... |
I got in touch with AWS support about the connectivity issues, they replied:
Im now in doubt if I should attempt to implement the retry mechanism (time consuming, uncertain result), or revert to the SDK (quick change and predictable result)... In the long run, this package should implement a retry/failure mechanism if it want to match the resiliency of the SDK? |
I believe this issue should be re-open. I'm currently reverting to aws sdk due to lack of retry support like the aws sdk does, specially in the session handler where is critical to happen otherwise users will have a poor experience when it fails. And let me tell you, it fails some times. The solution that was merged is not enough and is directly coupled to symfony, and symfony 5.2 was not released yet. I would really love to continue to use this lib but in the current state is not usable. |
FYI:
But we only use the sqs api client on lamdba (with retry on the sqs/lambda itself), with limited business impact, so no big deal. Unfortunately, the difference in resilience stops us from moving away from the heavy official AWS SDK to these clients. |
Hmm, it's weird those error are not retried. It's probably a bug.
Except the bug reported above, what kind of improvement can we make to fix that? |
Maybe this trace will help from Sentry. Im more than happy to track down if this is a bug or not. Contact me directly I ran into 2 'issues' earlier; DynamoDB marshalling, and the DynamoDB caps mentioned above |
This PR symfony/symfony#38426 will change the way request a retry. To only retry indempotent method. Issue is: Async-AWS always use POST (even when operation is safe). Meaning the following cases will not be retryied anymore:
@starred-gijs . Did you kept a dump of response or exception/error before you switched to RetryableClient? Possible solution:
|
Yes it helps a lot: We know those are 500 and 503 errors. We can trust AWS and override the Symfony streategy to retry 500 errors on POST methods. |
Hi, I start using this package instead of the official AWS SDK over a week ago, and since then I have been having connection issues, while new sending messages to SQS.
I run a serverless setup: "SQS => Lambda trigger" and execute Symfony Messenger with bref/symfony-messenger
During the handling of the messages, new messages are pushed to SQS.
Very occasionally this fails, but I dont understand why. The only difference I can think of with the AWS SDK is that it implements an retry schema.
Does anyone else experience these occasional failures? Some of the errors messages I extracted:
So I was considering, would it be possible/wise/useful to create a Retry middleware of some sort, that would handle these failures, and retry if appropriate?
The HttpClient should have some support for middlewares according to symfony/symfony#36779
The retry mechanism could mimimic eg https://github.com/aws/aws-sdk-php/blob/master/src/RetryMiddleware.php
The text was updated successfully, but these errors were encountered: