failsafe icon indicating copy to clipboard operation
failsafe copied to clipboard

Support staggered/hedged retries

Open timothybasanov opened this issue 4 years ago • 1 comments

Not a Contribution.

Currently Failsafe only allows to make a single retry at a time. Sometimes it's beneficial to make several retries at the same time and hope that one of them would be successful.

It would be nice if it would be possible to configure retry and timeout policies in such a way that:

  1. A first attempt starts with a timeout of 100ms
  2. After 10ms pass, a second attempt starts with a timeout of 90ms
  3. After another 20ms pass, a third attempt starts with a timeout of 70ms
  4. When any of the attempts succeed, results are returned back immediately
  5. All executions still in-flight are cancelled

It would be super helpful to have an attempt-specific timeout in ContextualSupplier, so that some special can be done with it on the application level.

timothybasanov avatar Aug 31 '21 00:08 timothybasanov

Not a Contribution.

To better align with #159, mentioning hedged requests as they are seemingly are a different name/flavor for staggered requests.

timothybasanov avatar Sep 30 '21 19:09 timothybasanov