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

Half Open State #7

Open
drgarcia1986 opened this issue Jan 30, 2020 · 1 comment
Open

Half Open State #7

drgarcia1986 opened this issue Jan 30, 2020 · 1 comment

Comments

@drgarcia1986
Copy link
Contributor

To follow the Nygard circuit breaker pattern we need to create the half-open state on the circuit breaker. :

There is now a third state present - half open - meaning the circuit is ready to make a real call as trial to see if the problem is fixed.

source

@rafa-acioly
Copy link

rafa-acioly commented Jul 21, 2020

I would like to address this issue but i have a few questions first, on the source that you provide there are a few things that i need more opinion about.

  1. The parameter last_failure_time

I was thinking that we can use the TTL value from the request_cache_key, this way we can compare this TTL value with the parameter circuit_timeout or we add a new parameter to use this value on a different cache key.

  1. The half-open state

The source text suggest two approaches:

Set the half-open state when the current state is open and a time is reached, example:

  • The circuit is open and it has been open for 1 minute, now we can "try" to call the method again, this would change the circuit to half-open, if the request succeed we close the circuit, otherwise we keep it open.

Set the half-open state based on the percentage of errors:

A more sophisticated approach might look at frequency of errors, tripping once you get, say, a 50% failure rate.

This one is a little confuse to me, it says that the half-open state will be use when the errors percentage reach 50%, this means that the we will only try 50% of the requests on purpose and fail the remain 50%?

About the implementation of this percentage errors, it will only available on the PercentageFailuresRule class? or we need to implement it for every rule?

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

2 participants