Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.x HystrixCircuitBreaker.HystrixCircuitBreakerImpl.circuitOpenedOrLastTestedTime #2014

Open
zhuhongxu opened this issue Apr 4, 2021 · 0 comments

Comments

@zhuhongxu
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant