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

Fix wrong calcuration of retry interval and detecting retry limit #3649

Merged
merged 8 commits into from
Mar 28, 2022

Commits on Mar 23, 2022

  1. retry_state: Fix wrong calcuration of interval

    The correct total retry time should be:
      c + c * b^1 + (...) + c*b^(k - 1)
    
    But the previous implementation was:
      c + c * b^0 + c * b^1 + (...) + c*b^(k - 1)
    
    where:
    
      * c: constant factor, @retry_wait
      * b: base factor, @retry_exponential_backoff_base
      * k: number of retry times, @max_retry_times
    
    Although the first retry interval is already added at constructor of
    ExponentialBackoffRetry, same value is added again unexpectedly on the
    first calc_interval call (as `c * b^0`).
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    2bfa8d8 View commit details
    Browse the repository at this point in the history
  2. Fix wrong retry limit detection

    The previous implementation detects @max_retry_times + 1 as limit,
    but the limit should be @max_retry_times.
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    adae64a View commit details
    Browse the repository at this point in the history
  3. Simplify handling limit steps of retry

    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    7e29932 View commit details
    Browse the repository at this point in the history
  4. test_output_as_buffered_secondary: Follow a recent change

    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    a2cbb42 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2022

  1. Add scenario test of RetryState

    RetryStatement behavior is complicated, so scenario tests may be useful.
    
    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and ashie committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    09f0aa5 View commit details
    Browse the repository at this point in the history
  2. Fix timeout handling

    Add 2 states to control timeout.
    
    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and ashie committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    4819ccf View commit details
    Browse the repository at this point in the history
  3. Just reshape codes

    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and ashie committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    e3f5034 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2022

  1. output: Unify logging retry error

    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Mar 25, 2022
    Configuration menu
    Copy the full SHA
    a4f15f9 View commit details
    Browse the repository at this point in the history