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

Support backup requests #300

Open
timothybasanov opened this issue Sep 30, 2021 · 1 comment
Open

Support backup requests #300

timothybasanov opened this issue Sep 30, 2021 · 1 comment

Comments

@timothybasanov
Copy link

timothybasanov commented Sep 30, 2021

Not a Contribution.

As mentioned in #159 and #291 there is an additional layer on top of hedged/staggered retries that we may need to support: backup requests. In short, backup requests are similar to fallbacks, but done in-parallel.

What's the difference with hedged retries? What features are required?

  • Backup requests are issued immediately and in parallel to the main request
  • Backup request results are not used unless the main request and its retries fail
  • We do not need to support fallbacks for a main request if a backup request is present

Ideally backup requests should support separate retry policies and circuit breakers. Both are needed for real world requests over the network. But even if retries/circuit breakers are not supported by a backup policy, a workaround would be to implement them as a separate Failsafe executor that is only used within a Fallback policy's lambda.

One of the ways to achieve this in terms of API would be to extend an existing Fallback policy to allow its execution to start in parallel to the main request.

@whiskeysierra
Copy link

Backup requests are issued immediately and in parallel to the main request

To the same target or an alternative one?

What's the difference with hedged retries?

I've seen the names backup requests and hedged requests as synonyms until now.

I've written a Backup request executor for failsafe before: https://github.com/zalando/riptide/blob/main/riptide-failsafe/src/main/java/org/zalando/riptide/failsafe/BackupRequestExecutor.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants