Skip to content

1.5.x HystrixCircuitBreaker.HystrixCircuitBreakerImpl.circuitOpenedOrLastTestedTime #2014

Open
@zhuhongxu

Description

@zhuhongxu

there has some code in isOpen method, as following:
if (circuitOpen.compareAndSet(false, true)) { circuitOpenedOrLastTestedTime.set(System.currentTimeMillis()); return true; } else { return true; }
if thread one invokes the circuitOpen.compareAndSet(false, true) yet but not start invoke circuitOpenedOrLastTestedTime.set(System.currentTimeMillis()),and thread two return true at
the same time, then thread two will invoke allowSingleTest() and get circuitOpenedOrLastTestedTime
but it is 0, because thread one not finish to invoke circuitOpenedOrLastTestedTime.set(System.currentTimeMillis()),
so that there will be a very little time during thread one finish to invoke circuitOpenedOrLastTestedTime.set(System.currentTimeMillis()) allowSingleTest() always return true.
I think this is a little bug.

Metadata

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