Skip to content

Commit d14443d

Browse files
committed
use static max heap threshold 100
Signed-off-by: Xun Zhang <xunzh@amazon.com>
1 parent 0d89332 commit d14443d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/src/main/java/org/opensearch/ml/breaker/MemoryCircuitBreaker.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class MemoryCircuitBreaker extends ThresholdCircuitBreaker<Short> {
1818
// TODO: make this value configurable as cluster setting
1919
private static final String ML_MEMORY_CB = "Memory Circuit Breaker";
2020
public static final short DEFAULT_JVM_HEAP_USAGE_THRESHOLD = 85;
21+
public static final short JVM_HEAP_MAX_THRESHOLD = 100; // when threshold is 100, this CB check is ignored
2122
private final JvmService jvmService;
2223
private volatile Integer jvmHeapMemThreshold = 85;
2324

@@ -50,6 +51,6 @@ public Short getThreshold() {
5051

5152
@Override
5253
public boolean isOpen() {
53-
return getThreshold() < 100 && jvmService.stats().getMem().getHeapUsedPercent() > getThreshold();
54+
return getThreshold() < JVM_HEAP_MAX_THRESHOLD && jvmService.stats().getMem().getHeapUsedPercent() > getThreshold();
5455
}
5556
}

0 commit comments

Comments
 (0)