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

Allow custom inspection of errors #29

Merged
merged 6 commits into from Jan 5, 2021

Conversation

dmarkhas
Copy link
Contributor

Not all errors should be counted towards tripping the circuit breaker, this PR adds support for a custom inspection strategy to determine if an error should trip the circuit breaker or not.

@xswordsx
Copy link

xswordsx commented Dec 2, 2020

This would be very useful for my usecase as well - Since gRPC returns errors to denote 4XX Status codes (e.g. NotFound) I am getting a lot of false-positives.

@YoshiyukiMineo
Copy link
Member

@dmarkhas

Sorry for the late reply. Your idea sounds good. But I think IsSuccessful is more straightforward than ShouldTrip.

@YoshiyukiMineo YoshiyukiMineo self-assigned this Dec 28, 2020
@dmarkhas
Copy link
Contributor Author

Renamed :)

Copy link
Member

@YoshiyukiMineo YoshiyukiMineo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added review comments.

gobreaker.go Outdated Show resolved Hide resolved
gobreaker.go Outdated Show resolved Hide resolved
gobreaker.go Show resolved Hide resolved
gobreaker.go Outdated Show resolved Hide resolved
gobreaker.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Dec 30, 2020

Coverage Status

Coverage increased (+0.04%) to 98.99% when pulling 2cbcbad on dmarkhas:inspect_err into 92b9680 on sony:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 97.98% when pulling 425c6ee on dmarkhas:inspect_err into 92b9680 on sony:master.

@dmarkhas
Copy link
Contributor Author

dmarkhas commented Jan 4, 2021

Thanks, I've addressed your comments.

@YoshiyukiMineo
Copy link
Member

Thank you!

@YoshiyukiMineo YoshiyukiMineo merged commit 9c3b944 into sony:master Jan 5, 2021
@xswordsx
Copy link

xswordsx commented Jan 5, 2021

Is the next version of the package coming out soon (as I am eagerly awaiting this feature) ?

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

Successfully merging this pull request may close these issues.

None yet

4 participants