[CORE] Log if CircuitBreaker is tripping
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
This commit is contained in:
parent
491a48e55b
commit
1792822bae
|
@ -90,9 +90,11 @@ public class ChildMemoryCircuitBreaker implements CircuitBreaker {
|
|||
@Override
|
||||
public void circuitBreak(String fieldName, long bytesNeeded) {
|
||||
this.trippedCount.incrementAndGet();
|
||||
throw new CircuitBreakingException("[" + this.name + "] Data too large, data for [" +
|
||||
final String message = "[" + this.name + "] Data too large, data for [" +
|
||||
fieldName + "] would be larger than limit of [" +
|
||||
memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]",
|
||||
memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]";
|
||||
logger.debug(message);
|
||||
throw new CircuitBreakingException(message,
|
||||
bytesNeeded, this.memoryBytesLimit);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,8 +79,10 @@ public class MemoryCircuitBreaker implements CircuitBreaker {
|
|||
*/
|
||||
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) + "]");
|
||||
final String message = "Data too large, data for field [" + fieldName + "] would be larger than limit of [" +
|
||||
memoryBytesLimit + "/" + new ByteSizeValue(memoryBytesLimit) + "]";
|
||||
logger.debug(message);
|
||||
throw new CircuitBreakingException(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue