Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Network retries #559
Network retries #559
Changes from 18 commits
195ab3f
572dae1
1344128
d278c68
709dc83
12f8b8a
fa27480
2c49d8e
adef6a7
4e4022e
c59d678
2a8d93e
2de2dc0
d8284bb
6d5ee2d
cba5368
91d7b36
bfbcce8
47942ce
0467144
a87b88a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
quick question:
the two errors we encounter most often when calling stripe that would be helped by using retries are
I cant find the http codes for those two, but wondering if this list would cover these two errors. Might be nice to let the client set the statuscodes to retry? i wonder if that'd open up the gates to people starting to retry 400s etc
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.
Hi @suchitagarwal , thanks, that's very helpful to hear!
As it is, the code will not handle
StripeAPIError
, which is status code 500, but will handleStripeConnectionError
. I'm going to change that to handle 500's too, but only when they are GET's or DELETE's (not POST).The reason for this is that there isn't really much point to retrying a 500'd POST request with an idempotency key, because our idempotency machinery will simply give you a 500 again.
I don't think we'll open up the logic for when to automatically retry, pretty much based for reasons like you mentioned (retrying a 400 isn't a great idea), but users can always implement retries themselves.
Thoughts?
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.
makes perfect sense. i think handling 500s for GET/DELETE should cover the cases we encounter most often, and not retrying POSTs makes sense. thanks a lot for the quick turnaround on this
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.
Awesome, thanks for the feedback!
Speaking of, I'm working on an unrelated feature and looking for some early beta users... if you're willing to try something out, drop me a line? email is
myGithubUsername.replace('-', '@') + '.com'
😉