Skip to content

Commit 23c51f5

Browse files
authored
Always check the parent breaker with zero bytes in PreallocatedCircuitBreakerService (#115181) (#115273)
PreallocatedCircuitBreakerService will call the parent breaker if the nunber of bytes passed is zero.
1 parent 855fb8f commit 23c51f5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/changelog/115181.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 115181
2+
summary: Always check the parent breaker with zero bytes in `PreallocatedCircuitBreakerService`
3+
area: Aggregations
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/common/breaker/PreallocatedCircuitBreakerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public void addEstimateBytesAndMaybeBreak(long bytes, String label) throws Circu
109109
if (closed) {
110110
throw new IllegalStateException("already closed");
111111
}
112-
if (preallocationUsed == preallocated) {
113-
// Preallocation buffer was full before this request
112+
if (preallocationUsed == preallocated || bytes == 0L) {
113+
// Preallocation buffer was full before this request or we are checking the parent circuit breaker
114114
next.addEstimateBytesAndMaybeBreak(bytes, label);
115115
return;
116116
}

0 commit comments

Comments
 (0)