-
Notifications
You must be signed in to change notification settings - Fork 5
does not auto resetting when we manual control #7
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
base: master
Are you sure you want to change the base?
Conversation
name old time/op new time/op delta ParallelCall-32 649ns ± 1% 559ns ± 2% -13.87% (p=0.100 n=3+3) ParallelCallFailed-32 503ns ± 0% 462ns ± 6% -8.02% (p=0.100 n=3+3)
e.g. network is interrupted quick flashing and recovery immediately.
|
Hi @ajwerner, |
ajwerner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, this does seem like a bug given the comments. Can you write a unit test?
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lrita)
circuitbreaker.go, line 240 at r1 (raw file):
// return true. func (cb *Breaker) Trip() { // should happen before Tripped()
This comment doesn't clarify much for me. I think you mean the reading of the time should happen before setting the atomics. Is that really causing any problems for you?
I don't mind the re-ordering of the statements but the comment is if anything more confusing than helpful because it doesn't say what should happen before Tripped().
|
@ajwerner there is a concurrent issue between setting Is it really cause a bug? Yes to original version of circuitbreaker, but no for current version. Because of 79eae79 make the exported We can think that there are many goroutines invoking After 79eae79 we redefinition the mechanism of circuitbreaker and exported I can delete the comment if you feel confused. |
|
I think I'm willing to merge this, mostly because we don't use |
Does not auto resetting when we manual control by Break().
This change is