Skip to content

Commit ef7b36a

Browse files
author
Max Hniebergall
committed
Avoid NPE in maybeStartAllocation
1 parent 64ae0ae commit ef7b36a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public boolean maybeStartAllocation(TrainedModelAssignment assignment) {
434434
if (assignment.getAdaptiveAllocationsSettings() != null
435435
&& assignment.getAdaptiveAllocationsSettings().getEnabled() == Boolean.TRUE
436436
&& (assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == null
437-
|| assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0)) {
437+
|| Integer.valueOf(0).equals(assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations()))) {
438438

439439
// Prevent against a flurry of scale up requests.
440440
if (deploymentIdsWithInFlightScaleFromZeroRequests.contains(assignment.getDeploymentId()) == false) {

0 commit comments

Comments
 (0)