Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Retry for all error codes >= 500 #1368

Merged
merged 3 commits into from
Mar 21, 2024
Merged

Conversation

ramya-stripe
Copy link
Contributor

@ramya-stripe ramya-stripe commented Mar 21, 2024

This PR updates the retry behavior in the Ruby SDK to be the same as rest of our languages in terms of when to retry for errors with code >=500

From @richardm-stripe who lead this investigation previously

The additional restrictions in stripe-go/stripe-ruby (don't bother retrying POST status=500) is a sensible optimization but the logic also misses some statuses (503/504/502) that possibly could succeed on retry. It's better for cases more granular than >=500 to be captured in the logic that produces x-stripe-should-retry rather than to be hardcoded/maintained across 7+ official server SDKs, Terminal SDKs, direct integrations, etc.

Related Jira: https://jira.corp.stripe.com/browse/DEVSDK-1711

Changelog

  • When no x-stripe-should-retry header is set in the response, the library now retries all requests with status >= 500, not just non-POST methods.
  • Remove method parameter from StripeClient.should_retry?

@ramya-stripe ramya-stripe marked this pull request as ready for review March 21, 2024 04:47
@ramya-stripe ramya-stripe merged commit 8aee86d into sdk-release/next-major Mar 21, 2024
13 checks passed
@ramya-stripe ramya-stripe deleted the ramya/retry branch March 21, 2024 19:58
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants