Serguey Asael Shinder: Micronaut 5.2.10 stops two beans sharing one circuit breaker through a base class
Micronaut 5.2.10 was released on 30 September with eight bug fixes. One of them is the kind of problem that is very hard to diagnose in production, because each service looks correctly configured on its own.
The release notes list it as "Give each bean its own circuit when the intercepted method is inherited", and pull request #13518 explains it.
What was wrong. DefaultRetryInterceptor keeps one circuit-breaker state per ExecutableMethod. The method's equals and hashCode compare only the declaring type, the method name and the argument types. If two beans inherit the intercepted method from a common superclass, the declaring type is the superclass for both, so both mapped to the same circuit. That circuit was created with the configuration of whichever bean called first. The pull request's example:
@Singleton @CircuitBreaker(attempts = '1', reset = '1s')
class FirstService extends BaseService {}
@Singleton @CircuitBreaker(attempts = '3', reset = '30s')
class SecondService extends BaseService {}

Once FirstService.call() opened the circuit, SecondService.call() rethrew FirstService's exception without being invoked at all, and it also ran with FirstService's attempts and reset timeout.
The fix. Circuits are now keyed by the class of the intercepted bean together with the method. The map stays bounded by the number of bean classes, and instances of the same bean, such as prototypes, still share one circuit as before. A new test proves that two beans with a shared superclass method get separate circuits, and fails without the change.
Who is exposed. Applications that put @CircuitBreaker on several beans extending one base class that declares the protected method, which is a common way to share client code between downstream services. The symptom is a service failing fast because a different dependency was down.
What I would do. Upgrade to 5.2.10. The pull request notes that the 5.3 line rewrites parts of this interceptor for named circuit breakers and that the change must be merged up separately, so on 5.3 check the release notes before assuming it is there.