Comcast / Comcast/jrugged

CircuitBreakers created by Annotation/Aspect have ambiguous configuration

Open
#70 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
268
Forks
95
PR merge metrics
No merged PRs in 30d

Description

Consider the following circuit breaker usage:
```
@CircuitBreaker(name = "sameCircuitBreaker", windowMillis = "30", limit = "3")
public void someMethod1() {

}

//... elsewhere in my code
@CircuitBreaker(name = "sameCircuitBreaker", windowMillis = "60", limit = "10")
public void someMethod2() {

}

```

It's not determinate which of the configurations will actually be used for your app (break if 10 errors in 60ms or 3 errors in 30?). Since the first configuration will be used to instantiate the default interpreter for my circuit breaker and subsequent usages will look up the CB by name without modifying the interpreter, you can't know which config will actually be used in production. See https://github.com/Comcast/jrugged/blob/master/jrugged-aspects/src/main/java/org/fishwife/jrugged/aspects/CircuitBreakerAspect.java#L87

This could maybe be fixed if this configuration for the interpreter for each named circuit breaker was set only once separately from these circuit breaker annotations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.