Skip to content

[ML] Autoscaling issue when context.currentCapacity() is null #116384

@qherreros

Description

@qherreros

Elasticsearch Version

7.17.24

Installed Plugins

No response

Java Version

bundled

OS Version

N/A

Problem Description

In MlMemoryAutoscalingDecider.java:

                MlMemoryAutoscalingCapacity capacity = ensureScaleDown(
                    result,
                    MlMemoryAutoscalingCapacity.from(context.currentCapacity()).build()
                );

the call context.currentCapacity() may result in null (see JavaDoc)

    /**
     * Return current capacity of nodes governed by the policy. Can be null if the capacity of some nodes is unavailable. If a decider
     * relies on this value and gets a null current capacity, it should return a result with a null requiredCapacity (undecided).
     */
    AutoscalingCapacity currentCapacity();

However MlMemoryAutoscalingCapacity.from(null) crashes.

Steps to Reproduce

N/A

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Labels

:mlMachine learning>bugTeam:MLMeta label for the ML team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions