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
[CURATOR-533] - improve circuit breaking behavior #320
Merged
shayshim
merged 1 commit into
master
from
CURATOR-505-improve-circuit-breaker-to-shared
Aug 12, 2019
Merged
[CURATOR-533] - improve circuit breaking behavior #320
shayshim
merged 1 commit into
master
from
CURATOR-505-improve-circuit-breaker-to-shared
Aug 12, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asfgit
force-pushed
the
CURATOR-505-improve-circuit-breaker-to-shared
branch
from
July 28, 2019 16:56
880479f
to
da67721
Compare
asfgit
force-pushed
the
CURATOR-505-improve-circuit-breaker-to-shared
branch
from
July 28, 2019 17:27
cd3e3cb
to
b1e6e71
Compare
Randgalt
changed the title
[CURATOR-533] - introduced circuit breaking behavior
[CURATOR-533] - improve circuit breaking behavior
Jul 28, 2019
shayshim
reviewed
Aug 3, 2019
curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionStateListener.java
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
curator-framework/src/main/java/org/apache/curator/framework/state/CircuitBreakingManager.java
Outdated
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
Outdated
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
Outdated
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
Outdated
Show resolved
Hide resolved
shayshim
reviewed
Aug 3, 2019
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.
Looks good other than the CircuitBreakingManager.removeListener.
shayshim
reviewed
Aug 3, 2019
curator-framework/src/main/java/org/apache/curator/framework/state/CircuitBreakingManager.java
Show resolved
Hide resolved
CURATOR-505 introduced circuit breaking behavior via CircuitBreakingConnectionStateListener and ConnectionStateListenerDecorator. Elastic has been using it to success but reports that the implementation can be improved. The existing implementation uses a new CircuitBreaker for each ConnectionStateListener set in a Curator client. It turns out that this is not ideal. Instead, a shared CircuitBreaker should be used per Curator client. Unfortunately, the best way to do this is to remove the ConnectionStateListenerDecorator semantics and use a different mechanism. This Issue proposes to do this and remove ConnectionStateListenerDecorator. This is a breaking change but given the short amount of time it's been in Curator it's unlikely that it's been widely adopted. In this commit, ConnectionStateListenerDecorator is removed in favor of ConnectionStateListenerManagerFactory. ConnectionStateManager uses this factory to create the container to hold registered ConnectionStateListeners. A new CircuitBreakerManager now manages the circuit breaking behavior using a shared CircuitBreaker.
asfgit
force-pushed
the
CURATOR-505-improve-circuit-breaker-to-shared
branch
from
August 12, 2019 14:34
b1e6e71
to
066ff40
Compare
@shayshim comments addressed and rebased |
shayshim
approved these changes
Aug 12, 2019
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.
@Randgalt Looks good, thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CURATOR-505 introduced circuit breaking behavior via
CircuitBreakingConnectionStateListener
andConnectionStateListenerDecorator
. Elastic has been using it to success but reports that the implementation can be improved. The existing implementation uses a newCircuitBreaker
for eachConnectionStateListener
set in a Curator client. It turns out that this is not ideal. Instead, a sharedCircuitBreaker
should be used per Curator client.Unfortunately, the best way to do this is to remove the
ConnectionStateListenerDecorator
semantics and use a different mechanism. This Issue proposes to do this and removeConnectionStateListenerDecorator
. This is a breaking change but given the short amount of time it's been in Curator it's unlikely that it's been widely adopted.In this commit,
ConnectionStateListenerDecorator
is removed in favor ofConnectionStateListenerManagerFactory
.ConnectionStateManager
uses this factory to create the container to hold registeredConnectionStateListeners
. A newCircuitBreakerManager
now manages the circuit breaking behavior using a sharedCircuitBreaker
.