Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: exponential random retry #223

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

Merged
merged 9 commits into from
May 11, 2021
Merged

feat: exponential random retry #223

merged 9 commits into from
May 11, 2021

Conversation

rhajek
Copy link
Contributor

@rhajek rhajek commented May 10, 2021

Proposed Changes

Improves exponential random retry strategy in write api like in python client influxdata/influxdb-client-python#225

Delay is computed using random exponential backoff as a random value within the interval retryInterval * exponentialBase^(attempts-1) and retryInterval * exponentialBase^(attempts).

Example for retryInterval=5_000, exponentialBase=2, maxRetryDelay=125_000, total=5

Retry delays are random distributed values within the ranges of [5_000-10_000, 10_000-20_000, 20_000-40_000, 40_000-80_000, 80_000-125_000]

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • mvn test completes successfully
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2021

Codecov Report

Merging #223 (e331b40) into master (97f54e7) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #223      +/-   ##
============================================
- Coverage     88.53%   88.52%   -0.02%     
  Complexity      449      449              
============================================
  Files           146      146              
  Lines          5724     5743      +19     
  Branches        274      277       +3     
============================================
+ Hits           5068     5084      +16     
  Misses          565      565              
- Partials         91       94       +3     
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/influxdb/client/WriteOptions.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
.../influxdb/client/internal/AbstractWriteClient.java 91.26% <100.00%> (+0.08%) 0.00 <0.00> (ø)
...ava/com/influxdb/client/internal/RetryAttempt.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...luxdb/client/kotlin/internal/QueryKotlinApiImpl.kt 83.58% <0.00%> (-4.48%) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97f54e7...e331b40. Read the comment docs.

@rhajek rhajek requested a review from bednar May 10, 2021 13:09
Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are just "code style" requested changes:

client/src/test/java/com/influxdb/client/WriteApiTest.java Outdated Show resolved Hide resolved
client/src/test/java/com/influxdb/client/WriteApiTest.java Outdated Show resolved Hide resolved
client/src/test/java/com/influxdb/client/WriteApiTest.java Outdated Show resolved Hide resolved
rhajek and others added 3 commits May 11, 2021 09:34
Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
@rhajek rhajek merged commit 527d0c8 into master May 11, 2021
@rhajek rhajek deleted the fix/random_retry branch May 11, 2021 07:43
@bednar bednar added this to the 2.3.0 milestone May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.