Commit e2be583 1 parent 96a6404 commit e2be583 Copy full SHA for e2be583
File tree 2 files changed +10
-9
lines changed
main/java/org/opensearch/ml/breaker
test/java/org/opensearch/ml/model
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public class MemoryCircuitBreaker extends ThresholdCircuitBreaker<Short> {
18
18
// TODO: make this value configurable as cluster setting
19
19
private static final String ML_MEMORY_CB = "Memory Circuit Breaker" ;
20
20
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
21
22
private final JvmService jvmService ;
22
23
private volatile Integer jvmHeapMemThreshold = 85 ;
23
24
@@ -45,6 +46,6 @@ public String getName() {
45
46
46
47
@ Override
47
48
public boolean isOpen () {
48
- return getThreshold () < 100 && jvmService .stats ().getMem ().getHeapUsedPercent () > getThreshold ();
49
+ return getThreshold () < JVM_HEAP_MAX_THRESHOLD && jvmService .stats ().getMem ().getHeapUsedPercent () > getThreshold ();
49
50
}
50
51
}
Original file line number Diff line number Diff line change @@ -1018,13 +1018,13 @@ private MLRegisterModelInput mockPretrainedInput() {
1018
1018
1019
1019
private MLRegisterModelInput mockRemoteModelInput (boolean isHidden ) {
1020
1020
return MLRegisterModelInput
1021
- .builder ()
1022
- .modelName (modelName )
1023
- .version (version )
1024
- .modelGroupId ("modelGroupId" )
1025
- .modelFormat (modelFormat )
1026
- .functionName (FunctionName .REMOTE )
1027
- .deployModel (true )
1028
- .build ();
1021
+ .builder ()
1022
+ .modelName (modelName )
1023
+ .version (version )
1024
+ .modelGroupId ("modelGroupId" )
1025
+ .modelFormat (modelFormat )
1026
+ .functionName (FunctionName .REMOTE )
1027
+ .deployModel (true )
1028
+ .build ();
1029
1029
}
1030
1030
}
You can’t perform that action at this time.
0 commit comments