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

[Docs] Replace textual descriptions of next delay calculation with diagrams #1922

Conversation

peter-csala
Copy link
Contributor

@peter-csala peter-csala commented Jan 25, 2024

Pull Request

The issue or feature being addressed

#1918

Details on the issue fix or feature implementation

  • Fixed some typos
  • Replaced textual description with diagram
    • Justification: Since they are considered implementation details, a diagram seems to me less "fine grained" and maybe easier to adjust later

Previews

Constant

stateDiagram-v2
    state if_state_step1 <<choice>>
    state if_state_step2 <<choice>>
    state if_state_step3 <<choice>>
    constant: Delay
    constantWJitter: Delay + Random
    compare: MaxDelay < BaseDelay
    setBase: Set BaseDelay
    setNormalized: Set NormalizedDelay
    setNext: Set NextDelay
    UseJitter --> if_state_step1
    if_state_step1 --> constantWJitter:true
    if_state_step1 --> constant: false
    constantWJitter --> setBase
    constant --> setBase
    setBase --> compare
    compare --> if_state_step2
    if_state_step2 --> MaxDelay: true
    if_state_step2 --> BaseDelay: false
    MaxDelay --> setNormalized
    BaseDelay --> setNormalized
    setNormalized --> DelayGenerator
    DelayGenerator --> if_state_step3
    if_state_step3 --> GeneratedDelay: positive
    if_state_step3 --> NormalizedDelay: null or negative
    GeneratedDelay --> setNext
    NormalizedDelay --> setNext
    setNext --> [*]
Loading

Linear

stateDiagram-v2
    state if_state_step1 <<choice>>
    state if_state_step2 <<choice>>
    state if_state_step3 <<choice>>
    linear: Delay * AttemptNumber
    linearWJitter: (Delay * AttemptNumber) + Random
    compare: MaxDelay < BaseDelay
    setBase: Set BaseDelay
    setNormalized: Set NormalizedDelay
    setNext: Set NextDelay
    UseJitter --> if_state_step1
    if_state_step1 --> linearWJitter:true
    if_state_step1 --> linear: false
    linearWJitter --> setBase
    linear --> setBase
    setBase --> compare
    compare --> if_state_step2
    if_state_step2 --> MaxDelay: true
    if_state_step2 --> BaseDelay: false
    MaxDelay --> setNormalized
    BaseDelay --> setNormalized
    setNormalized --> DelayGenerator
    DelayGenerator --> if_state_step3
    if_state_step3 --> GeneratedDelay: positive
    if_state_step3 --> NormalizedDelay: null or negative
    GeneratedDelay --> setNext
    NormalizedDelay --> setNext
    setNext --> [*]
Loading

Exponential

stateDiagram-v2
    state if_state_step1 <<choice>>
    state if_state_step2 <<choice>>
    state if_state_step3 <<choice>>
    exponential: Delay * AttemptNumber^2
    exponentialWJitter: Decorrelated Jitter Backoff V2
    compare: MaxDelay < BaseDelay
    setBase: Set BaseDelay
    setNormalized: Set NormalizedDelay
    setNext: Set NextDelay
    UseJitter --> if_state_step1
    if_state_step1 --> exponentialWJitter:true
    if_state_step1 --> exponential: false
    exponentialWJitter --> setBase
    exponential --> setBase
    setBase --> compare
    compare --> if_state_step2
    if_state_step2 --> MaxDelay: true
    if_state_step2 --> BaseDelay: false
    MaxDelay --> setNormalized
    BaseDelay --> setNormalized
    setNormalized --> DelayGenerator
    DelayGenerator --> if_state_step3
    if_state_step3 --> GeneratedDelay: positive
    if_state_step3 --> NormalizedDelay: null or negative
    GeneratedDelay --> setNext
    NormalizedDelay --> setNext
    setNext --> [*]
Loading

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (51044c5) 84.79% compared to head (34c77a1) 84.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1922   +/-   ##
=======================================
  Coverage   84.79%   84.79%           
=======================================
  Files         312      312           
  Lines        6893     6893           
  Branches     1056     1056           
=======================================
  Hits         5845     5845           
  Misses        839      839           
  Partials      209      209           
Flag Coverage Δ
linux 84.79% <ø> (ø)
macos ?
windows 84.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/strategies/retry.md Outdated Show resolved Hide resolved
docs/strategies/retry.md Outdated Show resolved Hide resolved
docs/strategies/retry.md Outdated Show resolved Hide resolved
docs/strategies/retry.md Outdated Show resolved Hide resolved
docs/strategies/retry.md Outdated Show resolved Hide resolved
@martincostello martincostello merged commit 1dcfc01 into App-vNext:main Jan 25, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants