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
Conversation
|
||
// 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\":{}}}"); |
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.
why not use the typed API for it?
few minor comments (they apply to other parts of the code). Can we also change |
@kimchy addressed your feedback and marked this as breaking. |
Actually, since there was no separate CircuitBreakerService implementations in 1.3, this isn't breaking! :) |
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! |
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.
Can we remove this line if it is not needed? At a glance it just looks like a broken test that was "simplified".
I left some comments on the tests, all minor. LGTM. |
4706af5
to
1c4d07c
Compare
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.
This adds a NoopCircuitBreaker, and then adds the dynamic settings
indices.breaker.fielddata.type
andindices.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.