Skip to content
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

feat: add exponential backoff strategy for retry #156

Merged
merged 7 commits into from
Oct 1, 2020

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Sep 30, 2020

Related to #145

Proposed Changes

  1. default value for retryInterval is 5_000
  2. added exponential backoff strategy for batch writes
    1. added maxRetries - the number of max retries when write fails - 3
    2. added maxRetryDelay - the maximum delay between each retry attempt in milliseconds - 180_000
    3. added exponentialBase - the base for the exponential retry delay, the next delay is computed as retryInterval * exponentialBase^(attempts-1) + random(jitterInterval)
    4. retry also network strategy
  3. other http request doesn't have retry strategy

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)

@bednar bednar marked this pull request as ready for review September 30, 2020 09:06
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2020

Codecov Report

Merging #156 into master will increase coverage by 0.16%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #156      +/-   ##
============================================
+ Coverage     90.13%   90.30%   +0.16%     
  Complexity      439      439              
============================================
  Files           137      138       +1     
  Lines          5375     5427      +52     
  Branches        205      215      +10     
============================================
+ Hits           4845     4901      +56     
+ Misses          452      450       -2     
+ Partials         78       76       -2     
Impacted Files Coverage Δ Complexity Δ
...rc/main/java/com/influxdb/client/WriteOptions.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...fluxdb/client/internal/AbstractInfluxDBClient.java 92.45% <100.00%> (+0.14%) 0.00 <0.00> (ø)
.../influxdb/client/internal/AbstractWriteClient.java 91.17% <100.00%> (+1.60%) 0.00 <0.00> (ø)
...ava/com/influxdb/client/internal/RetryAttempt.java 100.00% <100.00%> (ø) 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 d495d25...dabe9a4. Read the comment docs.

@bednar bednar requested a review from rhajek September 30, 2020 13:20
@bednar bednar merged commit e967762 into master Oct 1, 2020
@bednar bednar deleted the feat/expontential-retry branch October 1, 2020 08:44
@bednar bednar added this to the 1.12.0 milestone Oct 1, 2020
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