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

retry backoff strategies #216

Closed
yaythomas opened this issue Jan 15, 2021 · 0 comments
Closed

retry backoff strategies #216

yaythomas opened this issue Jan 15, 2021 · 0 comments
Assignees
Labels
type: core core functionality type: decorator step decorators up next features that are more or less on the TODO list

Comments

@yaythomas
Copy link
Member

yaythomas commented Jan 15, 2021

Currently the retry decorator works with a single static sleep interval.

Add backoff strategies better to enable linear, exponential sleep intervals in between retries with randomization (jitter).

Out of box, provide (assuming sleep interval is x and iteration/retry counter is n)

  • fixed (default) - sleep = x.
  • list - sleep = [x0, x1, x2] sleep picks the next value from a list. keep on returning last value when reaches the end and more retries necessary.
  • linear. sleep = nx
  • exponential. sleep = (2**n)*x
  • jitter variants for all the above (randomly select interval between a lower and upper bound given by the formula of the strategy)

In line with pypyr's ethos for complete customisation, also allow operator to create their own custom back-off strategy that will dynamically load as do steps/content parsers etc.

Thus,

step: mystep
retry:
  max: 3
  backoff: mypackage.mymod.myretrybackoffstrategy
@yaythomas yaythomas added up next features that are more or less on the TODO list type: core core functionality type: decorator step decorators labels Jan 15, 2021
@yaythomas yaythomas self-assigned this Jan 15, 2021
@yaythomas yaythomas added this to To do in pypyr roadmap via automation Jan 15, 2021
yaythomas added a commit that referenced this issue Jan 18, 2021
yaythomas added a commit that referenced this issue Jan 24, 2021
yaythomas added a commit that referenced this issue Jan 25, 2021
yaythomas added a commit that referenced this issue Jan 25, 2021
pypyr roadmap automation moved this from To do to Done Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: core core functionality type: decorator step decorators up next features that are more or less on the TODO list
Projects
pypyr roadmap
  
Done
Development

No branches or pull requests

1 participant