[ML] Omit uncomputed model stats#146186
Conversation
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.
|
Pinging @elastic/ml-core (Team:ML) |
|
Hi @prwhelan, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
There was a problem hiding this comment.
Pull request overview
Fixes ML usage reporting to avoid a potential NullPointerException when trained model size stats have not yet been computed, by omitting those uncomputed stats from the aggregated usage output.
Changes:
- Add a null-check around
modelSizeStatswhen aggregating trained model memory usage in ML usage reporting. - Add a unit test covering the case where
modelSizeStatsisnull. - Add a changelog entry for the bug fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportAction.java | Avoids NPE by skipping memory aggregation when modelSizeStats is missing. |
| x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/MachineLearningUsageTransportActionTests.java | Adds regression test for null modelSizeStats. |
| docs/changelog/146186.yaml | Documents the bug fix in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.
There is a chance that a model does not have its stats computed when usage is called, potentially throwing a NullPointerException. Usage will now skip models that do not have stats yet.