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

Refactor RequestRetrier into backoff and URI middleware #275

Closed
wants to merge 7 commits into from

Conversation

advayakrishna
Copy link
Contributor

@advayakrishna advayakrishna commented Mar 19, 2022

Before this PR

RequestRetrier was responsible for both selecting which URI to try next as well as implementing backoff behavior. This change breaks up that functionality into two separate middlewares:

  • URI middleware which selects a URI from a list of middlewares and adds it to the Request
  • Backoff middleware which implements retry backoff when a URI has been attempted previously

Motivation behind making this change is to enable further work like:

  • Cleaning up the URIScoringMiddleware API in the future, this can be used instead of the default URI middleware instead of in addition
  • Making it easier to modify Request properties in middleware e.g. Add rendezvous hash URI scorer #268
  • Provide consumers with clean APIs like Retrier or Middleware to add custom retry or URI selection logic to CGR

After this PR

==COMMIT_MSG==
Refactor RequestRetrier functionality into two separate middlewares. Backoff middleware implements retry backoff for URIs that have already been attempted and URI Middleware
==COMMIT_MSG==

Possible downsides?

No change in behavior or public API in this change so no apparent downsides.


This change is Reviewable

@changelog-app
Copy link

changelog-app bot commented Mar 19, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Refactor RequestRetrier functionality into two separate middlewares. Backoff middleware implements retry backoff for URIs that have already been attempted and URI Middleware

Check the box to generate changelog(s)

  • Generate changelog entry

@stale
Copy link

stale bot commented Apr 16, 2022

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant