From e9af05b15df220ee060f4fa21308945f9967a3b6 Mon Sep 17 00:00:00 2001 From: Jan Kuipers Date: Wed, 16 Oct 2024 09:56:05 +0200 Subject: [PATCH 1/3] Fix NPE in AdaptiveAllocationsScalerService --- .../adaptiveallocations/AdaptiveAllocationsScalerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java index 1c3a73a409dd1..9624d619ff20a 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java @@ -433,7 +433,8 @@ private void processDeploymentStats(GetDeploymentStatsAction.Response statsRespo public boolean maybeStartAllocation(TrainedModelAssignment assignment) { if (assignment.getAdaptiveAllocationsSettings() != null && assignment.getAdaptiveAllocationsSettings().getEnabled() == Boolean.TRUE - && assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0) { + && (assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == null + || assignment.getAdaptiveAllocationsSettings().getMinNumberOfAllocations() == 0)) { // Prevent against a flurry of scale up requests. if (deploymentIdsWithInFlightScaleFromZeroRequests.contains(assignment.getDeploymentId()) == false) { From 4603227bab6fe00a6d1ec21f7c092ad80e231abf Mon Sep 17 00:00:00 2001 From: Jan Kuipers <148754765+jan-elastic@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:00:15 +0200 Subject: [PATCH 2/3] Update docs/changelog/114880.yaml --- docs/changelog/114880.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/114880.yaml diff --git a/docs/changelog/114880.yaml b/docs/changelog/114880.yaml new file mode 100644 index 0000000000000..bb07ad2ff8b82 --- /dev/null +++ b/docs/changelog/114880.yaml @@ -0,0 +1,5 @@ +pr: 114880 +summary: Fix NPE in `AdaptiveAllocationsScalerService` +area: Machine Learning +type: bug +issues: [] From 6cec88d083c051e46acea13d46e0704044ab1aed Mon Sep 17 00:00:00 2001 From: Jan Kuipers <148754765+jan-elastic@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:10:36 +0200 Subject: [PATCH 3/3] Delete docs/changelog/114880.yaml --- docs/changelog/114880.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/changelog/114880.yaml diff --git a/docs/changelog/114880.yaml b/docs/changelog/114880.yaml deleted file mode 100644 index bb07ad2ff8b82..0000000000000 --- a/docs/changelog/114880.yaml +++ /dev/null @@ -1,5 +0,0 @@ -pr: 114880 -summary: Fix NPE in `AdaptiveAllocationsScalerService` -area: Machine Learning -type: bug -issues: []