failsafe-lib / failsafe

Fault tolerance and resilience patterns for the JVM
https://failsafe.dev
Apache License 2.0
4.2k stars 297 forks source link

[DISCUSS] Failsafe Roadmap #159

Open jhalterman opened 5 years ago

jhalterman commented 5 years ago

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

3.2

3.1

3.0

2.2:

For 2.0:

whiskeysierra commented 5 years ago
  • More Policy implementations including Bulkhead, RateLimiter, and Cache

What about backup requests or hedged requests?

jhalterman commented 4 years ago

@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?

whiskeysierra commented 4 years ago

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.

jhalterman commented 4 years ago

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

whiskeysierra commented 4 years ago

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

gelpenaddict commented 4 years ago

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.

jhalterman commented 4 years ago

@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)
timothybasanov commented 3 years ago

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.

jhalterman commented 3 years ago

@timothybasanov Can you open an issue for backup requests?