Fix failsafe composition and update README - #1872
Open
rameshmalla wants to merge 3 commits into
Open
Conversation
Signed-off-by: Ramesh Malla <ramesh.malla6@gmail.com>
Signed-off-by: Ramesh Malla <ramesh.malla6@gmail.com>
rameshmalla
marked this pull request as ready for review
September 1, 2026 09:39
rameshmalla
requested review from
fatroom and
lukasniemeier-zalando
as code owners
September 1, 2026 09:39
Contributor
|
👍 |
1 similar comment
Member
Author
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1859.
Description
Merges the four separate per-policy
FailsafePlugininstances (retry, circuit-breaker,backup-request, timeout) that riptide-spring-boot-autoconfigure registered per client into a
single
FailsafePluginper client, sharing onePolicylist and one executor.Key changes:
FailsafePluginFactory: replacedcreateRetryFailsafePlugin/createCircuitBreakerPlugin/createBackupRequestPlugin/createTimeoutPluginwith onecreateFailsafePlugin(...)thatbuilds a combined
List<RequestPolicy>(timeout → backup-request → retry → circuit-breaker)and applies it via a new
FailsafePlugin.withPolicies(List<RequestPolicy>)method(
riptide-failsafe).DefaultRiptideRegistrar: replaced the four separateregister*FailsafePlugin(...)methods withregisterFailsafePluginWithConfiguredPolicies(...),which registers one
FailsafePluginbean per client whenever any ofretry/circuit-breaker/backup-request/timeouts is enabled, and wires the (now optional) circuit
breaker bean into it directly.
riptide.clients.<id>.failsafe.threads, sharedby all four policies on a client. The old per-policy
retry.threads/circuit-breaker.threads/backup-request.threads/timeouts.threadssettings are nolonger supported — configuring any of them now fails fast at startup with a new
LegacyFailsafeThreadsExceptionpointing at the replacement property.RiptideProperties/Defaultingto add the newFailsafe/threadsconfig, and updatedtests (
FailSafeExecutorAutoConfigurationTest,PluginTest) and theriptide-spring-boot-autoconfigureREADME accordingly.Motivation and Context
Having four independent
Failsafeinstances per client (one per policy) meant their internalguards/executors didn't coordinate with each other, which could lead to deadlocks under
concurrent retry/circuit-breaker/backup-request/timeout execution on the same request. Merging
them into a single
FailsafePluginwith one shared executor fixes that coordination problem.Types of changes
— legacy per-policy
*.threadssettings now throw an exception at startup instead of being silently honored.Checklist: