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

[CURATOR-533] - improve circuit breaking behavior #320

Merged
merged 1 commit into from Aug 12, 2019

Conversation

Randgalt
Copy link
Member

@Randgalt Randgalt commented Jul 28, 2019

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 asfgit force-pushed the CURATOR-505-improve-circuit-breaker-to-shared branch from 880479f to da67721 Compare July 28, 2019 16:56
@Randgalt Randgalt requested review from shayshim and removed request for shayshim July 28, 2019 17:04
@asfgit asfgit force-pushed the CURATOR-505-improve-circuit-breaker-to-shared branch from cd3e3cb to b1e6e71 Compare July 28, 2019 17:27
@Randgalt Randgalt changed the title [CURATOR-533] - introduced circuit breaking behavior [CURATOR-533] - improve circuit breaking behavior Jul 28, 2019
Copy link
Contributor

@shayshim shayshim left a 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.

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 asfgit force-pushed the CURATOR-505-improve-circuit-breaker-to-shared branch from b1e6e71 to 066ff40 Compare August 12, 2019 14:34
@Randgalt Randgalt requested a review from shayshim August 12, 2019 14:34
@Randgalt
Copy link
Member Author

@shayshim comments addressed and rebased

Copy link
Contributor

@shayshim shayshim left a 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

@shayshim shayshim merged commit c670844 into master Aug 12, 2019
@tisonkun tisonkun deleted the CURATOR-505-improve-circuit-breaker-to-shared branch March 13, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants