Skip to content

Commit e9af05b

Browse files
committed
Fix NPE in AdaptiveAllocationsScalerService
1 parent 80c163e commit e9af05b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ private void processDeploymentStats(GetDeploymentStatsAction.Response statsRespo
433433
public boolean maybeStartAllocation(TrainedModelAssignment assignment) {
434434
if (assignment.getAdaptiveAllocationsSettings() != null
435435
&& assignment.getAdaptiveAllocationsSettings().getEnabled() == Boolean.TRUE
436-
&& assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0) {
436+
&& (assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == null
437+
|| assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0)) {
437438

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

0 commit comments

Comments
 (0)