Skip to content

CircuitBreakers created by Annotation/Aspect have ambiguous configuration #70

Open
@atroutt

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions