-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Proposal: CURLE_RECV_ERROR (56) should retry #983
Comments
You can probably setup guzzle 6's retry middleware. |
While researching my options (which including messing with retry middleware) I found #767. It sounds like this is a "rare but persistent" issue that happens to multiple SDK consumers, so I'm proposing the SDK handle it for everyone by default rather than by custom configuration. |
#767 was added because the idempotency characteristics of S3's API are well-defined and well-understood. That's generally not true of other services, where idempotency depends on factors unknown to the SDK when it's executing a command. Whether a Instances of |
This is great information! I agree it's clearly not appropriate for the SDK to blindly retry CURL_RECV_ERROR. I'm trying to figure out if there is a generic way of detecting which exceptions to retry if I know the call is idempotent. I see that AwsException provides getAwsErrorType(). I think the possible values are null, "client" and "server" (strings) and I'd want to retry "server". What about null? It's hard to puzzle through from the code but I think it's null on connection errors. I'm not sure what other conditions lead to null though... |
If you encounter a server error when executing a |
My backend processing can handle duplicate SQS messages. I believe everyone is in the same boat (needing to ensure SQS processing is idempotent) because of the "at least once" guarantee of ReceiveMessage. I believe I've also seen this particular error in DynamoDB API calls, but I'd have to dig through old logging to be sure. The only two APIs I use at high volume are SQS and DynamoDB, so it makes sense that a rare event like this would pop out on those two for me. I pretty much try to make sure all my AWS API calls either are either idempotent or at least don't cause chaos if applied multiple times due to these kinds of networking glitch possibilities. What I haven't been great at is knowing all of the places in configuration or integration of the SDK to properly retry requests to maximize the probability they are applied "at least once". |
@oberman The retry middleware's internal logic can be overridden when it's not appropriate for a given use case. The middleware's constructor takes a callable decider function, which by default takes the general case into account. If you know that your DynamoDB commands have a |
The root issue: Guzzle considers CURLE_RECV_ERROR to be RequestException instead of a ConnectException which causes the AWS SDK to throw an service exception (like SqsException). An example of Curl debugging when this happens to me:
It appears that issue #767 was resolved by patching S3Client to retry CURLE_RECV_ERROR (2f985ba). I agree with the patch, but feel any API request with this error should be retried.
The text was updated successfully, but these errors were encountered: