Skip to content

Commit f9168b9

Browse files
[ML] Improve reason when autoscaling capacity cannot be computed (#89316) (#89320)
When we cannot compute autoscaling capacity we call `MlAutoscalingDeciderService.buildDecisionAndRequestRefresh`. There are 4 callers. 3 of them set their own specific reason before the call. However, the method overwrites the reason with the generic `MEMORY_STALE` msg. This commit addresses this issue which should bubble up more detailed reasons for those edge cases. Co-authored-by: Elastic Machine <[email protected]>
1 parent 61ad7d5 commit f9168b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public AutoscalingDeciderResult scale(Settings configuration, AutoscalingDecider
507507
"view of job memory is stale given duration [{}]. Not attempting to make scaling decision",
508508
mlMemoryTracker.getStalenessDuration()
509509
);
510-
return buildDecisionAndRequestRefresh(reasonBuilder);
510+
return buildDecisionAndRequestRefresh(reasonBuilder.setSimpleReason(MEMORY_STALE));
511511
}
512512
// We need the current node loads to determine if we need to scale up or down
513513
List<NodeLoad> nodeLoads = new ArrayList<>(mlNodes.size());
@@ -1163,7 +1163,7 @@ Optional<NativeMemoryCapacity> calculateFutureAvailableCapacity(PersistentTasksC
11631163

11641164
private AutoscalingDeciderResult buildDecisionAndRequestRefresh(MlScalingReason.Builder reasonBuilder) {
11651165
mlMemoryTracker.asyncRefresh();
1166-
return new AutoscalingDeciderResult(null, reasonBuilder.setSimpleReason(MEMORY_STALE).build());
1166+
return new AutoscalingDeciderResult(null, reasonBuilder.build());
11671167
}
11681168

11691169
private Long getAnalyticsMemoryRequirement(String analyticsId) {

0 commit comments

Comments
 (0)