When Online Adaptation of Resilience Policies Hurts: Safe Exploration and Measurement Pitfalls in Resilience4j
Abstract
Circuit breaker, retry, and bulkhead settings in Java microservices are tuned once and frozen, although the best setting depends on the fault a dependency is currently showing. We study whether an online learner can pick these settings at runtime. AdaptR4j swaps Resilience4j policies atomically in Spring Boot 3 and lets a contextual bandit choose among complete CircuitBreaker/Retry/Bulkhead configurations from Prometheus signals. Our first, naive design scored worse than keeping the default policy in three of four winnable fault scenarios under the reward it optimised: exploring a menu that contained aggressive circuit breakers rejected most traffic while the learner was still learning. Two safeguards fix this: a safe policy menu (no breaker stricter than the latency SLO) and safe exploration with a bounded reward. With them, AdaptR4j beats the production default in every winnable scenario (p < 0.001, three runs each, run-to-run SD <= 0.03), beats the best fixed policy when the fault changes over time, and cuts user-visible failures up to 3.7x compared with the naive design. A context-free bandit on the same safe menu performs statistically indistinguishably, so the safeguards - not the learner - carry most of the benefit. We also report how an earlier version of our harness produced convincing but wrong results: a unit mismatch made every circuit breaker 100x too strict and rejected calls were invisible to the metrics, so 94% of user requests failed while latency and error metrics looked excellent.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI, cs.DC, cs.SE
- Comments
- 4 pages, 2 tables, 1 figure. Code and data: https://github.com/rajatbarot24/adaptr4j
Related papers
Where Agent Defenses Fail: A Case Study of Policy Compositions and Measurement Limits
Shared title terminologycs.CRKunwar Sangram Singh, Krishna Mohan Guda Nagavenkata Srinivasa
Poisoning Self-Evolving Security Policies in LLM Agents
Shared title terminologycs.CRAymen Noor, Honglu Jiang
A Bernstein-Type Variance-Adaptive PMW Mechanism for DP Query Release
Shared title terminologycs.CRMohamed Aniss Benstaali, Habib Louafi, Naima Bessah
A Star is Reborn: The PHP Interpreter Rewritten in Safe Rust
Shared title terminologycs.CRTianyu Li, Bo Wang, Prateek Saxena et al.
When Answering Is Administering: Permission Replies That Rewrite Coding-Agent Policy
Shared title terminologycs.CRZeming Fei, Hongming Fei, Jingwen Chen et al.
Agentic Discovery of Soundness Bugs in Safe Rust Bindings
Shared title terminologycs.CRMarius Momeu, Koushik Sen