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

Circuit Breakers: Log if CircuitBreaker is tripping #8050

Merged
merged 1 commit into from
Oct 10, 2014

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Oct 10, 2014

today we only throw an exception which might not be logged at all. this PR adds debug logging if we tripping a CB. It's debug for now but I might even vote for info?

@bleskes
Copy link
Contributor

bleskes commented Oct 10, 2014

LGTM

@@ -79,8 +79,12 @@ public MemoryCircuitBreaker(ByteSizeValue limit, double overheadConstant, Memory
*/
public void circuitBreak(String fieldName, long bytesNeeded) throws CircuitBreakingException {
this.trippedCount.incrementAndGet();
throw new CircuitBreakingException("Data too large, data for field [" + fieldName + "] would be larger than limit of [" +
memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]");
String message = "Data too large, data for field [" + fieldName + "] would be larger than limit of [" +
Copy link
Member

Choose a reason for hiding this comment

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

This string could be final also

@dakrone
Copy link
Member

dakrone commented Oct 10, 2014

LGTM, I vote for INFO level :)

@s1monw
Copy link
Contributor Author

s1monw commented Oct 10, 2014

updated the PR

@dakrone
Copy link
Member

dakrone commented Oct 10, 2014

LGTM

@kimchy
Copy link
Member

kimchy commented Oct 10, 2014

since this is a message that we already return to the user, and potentially can be repeated a lot, typically in ES we do those as debug messages. If we decide to change those logging levels, I prefer to do it across the board then to be inconsistent.

Btw, what I saw is that most of the times where "info" logging was requested, actually what was missing is adding it to our stats API.

memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]");
final String message = "Data too large, data for field [" + fieldName + "] would be larger than limit of [" +
memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]";
if (logger.isInfoEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

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

do we need this if here?

@s1monw
Copy link
Contributor Author

s1monw commented Oct 10, 2014

I moved back to debug and removed the guard - I don't want this to be controversial

Today we only throw an exception which might not be logged at all. This
commit adds debug logging if we are tripping a CB.

Closes elastic#8050
s1monw added a commit that referenced this pull request Oct 10, 2014
Today we only throw an exception which might not be logged at all. This
commit adds debug logging if we are tripping a CB.

Closes #8050
s1monw added a commit that referenced this pull request Oct 10, 2014
Today we only throw an exception which might not be logged at all. This
commit adds debug logging if we are tripping a CB.

Closes #8050
@s1monw s1monw merged commit 1792822 into elastic:master Oct 10, 2014
@clintongormley clintongormley changed the title [CORE] Log if CircuitBreaker is tripping Circuit Breakers: Log if CircuitBreaker is tripping Nov 3, 2014
@clintongormley clintongormley added the :Core/Infra/Circuit Breakers Track estimates of memory consumption to prevent overload label Mar 19, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
Today we only throw an exception which might not be logged at all. This
commit adds debug logging if we are tripping a CB.

Closes elastic#8050
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 >enhancement v1.4.0 v1.5.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants