Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fix node serialization on GET df-nalytics stats without id #54808

Conversation

dimitris-athanasiou
Copy link
Contributor

Previously, the id of the GetDataFrameAnalyticsStatsAction.Request
could be null which caused NPE on serialization as writeString
is used (it doesn't accept null values).

This commit ensures the id is never null.

Closes #54807

Previously, the id of the `GetDataFrameAnalyticsStatsAction.Request`
could be `null` which caused NPE on serialization as `writeString`
is used (it doesn't accept null values).

This commit ensures the id is never null.

Closes elastic#54807
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I prefer the pattern of making the field final and only setting it in the constructor which would have prevented this bug in the first place.

@dimitris-athanasiou
Copy link
Contributor Author

@davidkyle I agree with you. However, doing so now would be a breaking change of the transport client for the 7.x series.

@dimitris-athanasiou dimitris-athanasiou merged commit 1d28fb6 into elastic:master Apr 6, 2020
@dimitris-athanasiou dimitris-athanasiou deleted the fix-node-serialization-on-get-df-analytics-stats-without-id branch April 6, 2020 14:23
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Apr 6, 2020
…lastic#54808)

Previously, the id of the `GetDataFrameAnalyticsStatsAction.Request`
could be `null` which caused NPE on serialization as `writeString`
is used (it doesn't accept null values).

This commit ensures the id is never null.

Closes elastic#54807

Backport of elastic#54808
dimitris-athanasiou added a commit that referenced this pull request Apr 6, 2020
…54808) (#54813)

Previously, the id of the `GetDataFrameAnalyticsStatsAction.Request`
could be `null` which caused NPE on serialization as `writeString`
is used (it doesn't accept null values).

This commit ensures the id is never null.

Closes #54807

Backport of #54808
dimitris-athanasiou added a commit that referenced this pull request Apr 6, 2020
…54808) (#54812)

Previously, the id of the `GetDataFrameAnalyticsStatsAction.Request`
could be `null` which caused NPE on serialization as `writeString`
is used (it doesn't accept null values).

This commit ensures the id is never null.

Closes #54807

Backport of #54808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Serialization error on get DF analytics stats action when no id is set
5 participants