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: exponential random retry #76

Merged
merged 4 commits into from
May 19, 2021
Merged

feat: exponential random retry #76

merged 4 commits into from
May 19, 2021

Conversation

rhajek
Copy link
Contributor

@rhajek rhajek commented May 18, 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
  • make test completes successfully
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2021

Codecov Report

Merging #76 (fdbb568) into master (eba35d4) will increase coverage by 0.70%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #76      +/-   ##
============================================
+ Coverage     82.08%   82.78%   +0.70%     
- Complexity      364      375      +11     
============================================
  Files            22       23       +1     
  Lines           854      889      +35     
============================================
+ Hits            701      736      +35     
  Misses          153      153              
Impacted Files Coverage Δ Complexity Δ
src/InfluxDB2/DefaultApi.php 83.33% <ø> (-1.05%) 15.00 <0.00> (-2.00)
src/InfluxDB2/WriteApi.php 100.00% <100.00%> (ø) 21.00 <0.00> (-10.00)
src/InfluxDB2/WriteOptions.php 100.00% <100.00%> (ø) 1.00 <0.00> (ø)
src/InfluxDB2/WriteRetry.php 100.00% <100.00%> (ø) 17.00 <17.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 eba35d4...fdbb568. Read the comment docs.

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.

Thanks for PR 👍, There is a requirement that should be satisfy before we accept the PR:

src/InfluxDB2/WriteRetry.php Outdated Show resolved Hide resolved
@rhajek rhajek merged commit 8b390b7 into master May 19, 2021
@rhajek rhajek deleted the feat/random_retry branch May 19, 2021 08:11
@bednar bednar added this to the 1.14.0 milestone Jun 4, 2021
peynman pushed a commit to peynman/influxdb-client-php that referenced this pull request Mar 7, 2023
* feat: exponential random retry
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