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
Retry with backoff on cluster connection failures #2358
Retry with backoff on cluster connection failures #2358
Changes from 21 commits
6e2f312
5a4fdbd
fc3728a
cdf56b2
d99ef7b
8978ca5
85fa21c
f8d09c2
9c7ef1d
9bce8eb
67a062a
7e4abac
eabf10b
3223404
fd17343
bf56639
c7ae6b5
569afe7
1638603
68e8fdc
c665dc1
d9f2596
a23d602
6dd86db
fed69b0
791180c
4bf345b
62a619e
f1c307d
8a9e0a8
25c63a4
9b6242f
73d74d3
d14174d
af5d1f7
ddd4038
7aa0b74
0ef36d3
25303b7
9e3fbcc
882dd49
7430b9b
9eb8d58
27bce50
b900a87
4501b0d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
Taking the the time on each successful call seems like a waste and might impact the performance.
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.
@gkorland According to https://www.alibabacloud.com/blog/performance-issues-related-to-localdatetime-and-instant-during-serialization-operations_595605
Throughput of Instant.now+atZone+format+DateTimeFormatter.ofPattern is 6816922.578 ops/sec.
Without any formatting, throughput of Instant.now+plus should be much higher. Shouldn't it be enough?
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.
Why divide by the square of attempts? (Just wondering if it is specific or an arbitrary decision?)
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.
Kind of arbitrary. Not squared would work as well. The important thing is that the sleeps get longer and longer the fewer iterations that you have left, and that the last sleep uses up all of the time remaining.
Example: Let's say you have max 10s and max 5 attempts.
At time 0.0, 5 attempts left, sleep
(10s/(5*5))
= 0.4sAt time 0.4, 4 attempts left, sleep
(9.6s/(4*4))
= 0.6sAt time 1.0, 3 attempts left, sleep
(9s/(3*3))
= 1.0sAt time 2.0, 2 attempts left, sleep
(8/(2*2))
= 2.0sAt time 6.0, 1 attempts left, sleep
(4/(1*1))
= 4.0sThere 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.
Should this be
private
?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.
No,
protected
enables overriding in unit tests.