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
Provide backoff for retryable aws requests and the option to adjust the cf status check interval via an environment variable #6981
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6981 +/- ##
=========================================
+ Coverage 88.42% 88.5% +0.07%
=========================================
Files 229 229
Lines 8416 8428 +12
=========================================
+ Hits 7442 7459 +17
+ Misses 974 969 -5
Continue to review full report at Codecov.
|
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 @philiiiiiipp !
Still let's first clarify use case at #6980, before moving forward with 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.
Thank you @philiiiiiipp In general looks good. I've added few minor remarks
I somehow cannot answer on your comments anymore. I believe that last unresolved one was about the backoff. In my opinion its a good pattern to have, but having a jitter in combination with the ability to increase the interval at the other place would suffice for my use case at least. I am not that knowledgeable in the codebase though, so if you prefer not having an increasing backoff, I am cool with that too. |
Can you elaborate why you see it useful in that case? To me backoff serves well cases where we deal with a long wait time, and there's no point to check often. While here we deal with cases where there are short requests, and issue is that in some cases they're issued at very same time, so with fixed frequency they clash. In such case jitter seems the only solution that could indeed help, I would like to avoid adding functionalities that do not serve real purpose (do not complicate things when it's not justified) |
Right, we are doing requests against an aws endpoint, which might be congested, not only because of sls, but in general because there are many other clients trying to reach it. So if you want to allow the endpoint to recover it makes sense to slowly back off until your retries are used up. https://docs.aws.amazon.com/general/latest/gr/api-retries.html Like I said I am not married to this, I am more eager to get the jitter and the custom frequency option in, in order to stop using our forked version. So if you feel that this makes more harm than good I will remove it and we can always revisit it at a later stage. |
My feeling is that adding extra 5s every time, in this specific case, will rather bring experience downgrade than upgrade. I would also narrow wait range to something as 4-7s. The way it's configured now is 5-10s, so again that will make waits noticeably longer from what we have in master. Technically I think it'll be good to focus in this PR purely on adding jitter, and maintain interval time on similar level as we have now. The other reason I'm reluctant to make any bigger changes here, is that I don't remember having any other reports, that concerns that retry logic. So ideal approach seems to fix it for you by adding a jitter, but at same time maintain similar interval times, to keep experience not different for all other framework users. |
Right, that makes sense, I adjusted the interval to 4-7 seconds and removed the increasing backoff. |
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.
Thanks for working on this @philiiiiiipp and thanks for reviewing @medikoo 👍
I just ran Prettier to make the build pass on Travis. Other than that I looked through the code and it looks good!
@medikoo could you do a final review and merge once you think all your concerns were addressed?
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 @philiiiiiipp !
What did you implement
Closes #6980
I did create that inside the github console, given the simple logic I do believe that its fine. But those might also be famous last words!
Is this ready for review?: YES
Is it a breaking change?: NO