failsafe icon indicating copy to clipboard operation
failsafe copied to clipboard

[DISCUSS] Failsafe Roadmap

Open jhalterman opened this issue 6 years ago • 9 comments

This issue sketches out some of the past and future roadmap for Failsafe, and will be updated over time. Feel free to comment with suggestions.

3.x

  • [ ] Phi accrural failure detection
  • [ ] Backup requests
  • [ ] Hedged retries

3.2

  • [x] Bulkhead

3.1

  • [x] Rate limiter

3.0

  • [x] Make some internal APIs more open #292
  • [x] Re-work Execution and AsyncExecution APIs #287
  • [x] Consider more explicit functional composition APIs #254
  • [x] Policy builders #299

2.2:

  • [x] Cancellable async executions, backed by ForkJoinPool
  • [x] Timeout policy

For 2.0:

  • [x] Move to Java 8 as a requirement
  • [x] Add a ForkJoinPool.commonPool based Scheduler implementation
  • [x] Composable policy execution
    • Allow policies to be arbitrarily composed.
  • [x] Policy SPI
    • The SPI allows 3rd party policies to be plugged into Failsafe
    • The PolicyExecutor SPI allows policies to perform pre or post execution result handling
  • [x] Re-thinking event listeners - See #154
  • [x] Execution API improvements - See #160
  • [x] Doc updates

jhalterman avatar Dec 28 '18 07:12 jhalterman

  • More Policy implementations including Bulkhead, RateLimiter, and Cache

What about backup requests or hedged requests?

  • https://blog.acolyer.org/2015/01/15/the-tail-at-scale/
  • https://github.com/zalando/riptide/tree/master/riptide-backup

whiskeysierra avatar Aug 19 '19 09:08 whiskeysierra

@whiskeysierra Do you have another pointer for backup requests?

I suspect both of these would be specific to Http or other client/server technologies. Do you think there's a way to write policies for these in a way that's not specific to particular technologies and external dependencies?

jhalterman avatar Dec 20 '19 17:12 jhalterman

Technically it's just a different flavor of retries. Retries right now are triggered by exceptions (or unacceptable results) while backup requests are somewhat like an early retry caused by latency/delay. Can apply to anything, not just HTTP.

whiskeysierra avatar Dec 20 '19 18:12 whiskeysierra

Thanks - so to be clear, Riptide's backup requests are the same pattern as hedged requests?

jhalterman avatar Dec 20 '19 19:12 jhalterman

Yes, backup requests and hedged requests are the same thing. Just different names.

whiskeysierra avatar Dec 21 '19 13:12 whiskeysierra

Can you add a succeed on a Throwable? So that it keeps retrying if there is no exception and succeeds when you get a particular exception.

gelpenaddict avatar Apr 09 '20 03:04 gelpenaddict

@gelpenaddict Yea, by default throwables are handled (treated as failures) but you can override that via handleIf to specify that you want to "handle" (retry) on certain results, else not (which means failures/exceptions will not be retried). Ex:

retryPolicy.handleIf((result, failure) -> result == someBadValue)

jhalterman avatar Apr 09 '20 04:04 jhalterman

Not a Contribution.

Not sure if I understand backup requests correctly, so I'm describing a behaviour that would be nice to have in my case:

Backup request is a bit different from a hedged one. It's more similar to an existing Fallback policy, but it starts its execution immediately, in parallel to the main request. Its results are only used when the main request fails. It may also need some retries/circuit breakers/fallbacks configured.

This is good for gradual service degradation where I can use a different and much less heavy request as a backup to the main request that may not be able to finish in time.

timothybasanov avatar Sep 30 '21 01:09 timothybasanov

@timothybasanov Can you open an issue for backup requests?

jhalterman avatar Sep 30 '21 02:09 jhalterman