You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 invokecircuitOpenedOrLastTestedTime.set(System.currentTimeMillis())
,and thread tworeturn true
atthe 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.
The text was updated successfully, but these errors were encountered: