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 setting individual breakers to "noop" breakers #8135

Merged
merged 1 commit into from Oct 20, 2014

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Oct 17, 2014

This adds a NoopCircuitBreaker, and then adds the dynamic settings
indices.breaker.fielddata.type and indices.breaker.request.type,
which can be set to "noop" in order to use a breaker that will never
break, and incurs no overhead during computation.

This also refactors the tests for the CircuitBreakerService to use
@before and @after functions as well as adding settings in
ElasticsearchIntegrationTest to occasionally use NOOP breakers for all
tests.


// execute a search that loads field data (sorting on the "test" field)
// again, this time it should NOT trip the breaker
client.prepareSearch("cb-test").setSource("{\"sort\": \"test\",\"query\":{\"match_all\":{}}}");
Copy link
Member

Choose a reason for hiding this comment

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

why not use the typed API for it?

@kimchy
Copy link
Member

kimchy commented Oct 17, 2014

few minor comments (they apply to other parts of the code).

Can we also change indices.breaker.breaker_impl to indices.breaker.type?

@dakrone
Copy link
Member Author

dakrone commented Oct 17, 2014

@kimchy addressed your feedback and marked this as breaking.

@dakrone dakrone removed the >breaking label Oct 17, 2014
@dakrone
Copy link
Member Author

dakrone commented Oct 17, 2014

Actually, since there was no separate CircuitBreakerService implementations in 1.3, this isn't breaking! :)

@kimchy
Copy link
Member

kimchy commented Oct 17, 2014

LGTM, would love someone to have another look at the tests

private String randomRidiculouslySmallLimit() {
// 3 different ways to say 100 bytes
return randomFrom(Arrays.asList("100b", "100"));
//, (10000. / JvmInfo.jvmInfo().getMem().getHeapMax().bytes()) + "%")); // this is prone to rounding errors and will fail if JVM memory changes!
//, (10000. / JvmInfo.jvmInfo().getMem().getHeapMax().bytes()) + "%")); // this is prone to rounding errors and will fail if JVM memory changes!
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this line if it is not needed? At a glance it just looks like a broken test that was "simplified".

@rjernst
Copy link
Member

rjernst commented Oct 17, 2014

I left some comments on the tests, all minor. LGTM.

@dakrone dakrone force-pushed the add-noop-breakers branch 2 times, most recently from 4706af5 to 1c4d07c Compare October 20, 2014 08:43
This adds a NoopCircuitBreaker, and then adds the settings
`indices.breaker.fielddata.type` and `indices.breaker.request.type`,
which can be set to "noop" in order to use a breaker that will never
break, and incurs no overhead during computation.

This also refactors the tests for the CircuitBreakerService to use
@before and @after functions as well as adding settings in
ElasticsearchIntegrationTest to occasionally use NOOP breakers for all
tests.
@dakrone dakrone merged commit 1c4d07c into elastic:master Oct 20, 2014
@jpountz jpountz removed the review label Oct 21, 2014
@clintongormley clintongormley changed the title Allow setting individual breakers to "noop" breakers Circuit Breakers: Allow setting individual breakers to "noop" breakers Nov 3, 2014
@dakrone dakrone deleted the add-noop-breakers branch November 11, 2014 12:44
@clintongormley clintongormley added the :Core/Infra/Circuit Breakers Track estimates of memory consumption to prevent overload label Jun 6, 2015
@clintongormley clintongormley changed the title Circuit Breakers: Allow setting individual breakers to "noop" breakers Allow setting individual breakers to "noop" breakers Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Circuit Breakers Track estimates of memory consumption to prevent overload >feature v1.4.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants