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] Better error when persistent task assignment disabled #52014

Merged

Conversation

droberts195
Copy link
Contributor

Changes the misleading error message when attempting to open
a job while the "cluster.persistent_tasks.allocation.enable"
setting is set to "none" to a clearer message that names the
setting.

Closes #51956

Changes the misleading error message when attempting to open
a job while the "cluster.persistent_tasks.allocation.enable"
setting is set to "none" to a clearer message that names the
setting.

Closes elastic#51956
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

exception = makeNoSuitableNodesException(logger, params.getJobId(), assignment.getExplanation());
if (assignment.equals(AWAITING_UPGRADE)) {
exception = makeCurrentlyBeingUpgradedException(logger, params.getJobId(), assignment.getExplanation());
} else if (assignment.getExplanation().contains("[" + EnableAssignmentDecider.ALLOCATION_NONE_EXPLANATION + "]")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not ideal that this is done using contains. The better solution would be to make Assignments contain a reason number or enum value as well as a text reason. Then we could check that. But that's obviously a pretty far-reaching change. It may be worth waiting until there are more use cases for a reason code so that any implementation can take all the use cases into account.

Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

should work for the kibana UI as well.

@benwtrent
Copy link
Member

Just checked the error displayed in kibana, looks good:

image

@droberts195 droberts195 merged commit ec9d044 into elastic:master Feb 11, 2020
@droberts195 droberts195 deleted the improve_assignment_disabled_error branch February 11, 2020 15:22
droberts195 added a commit that referenced this pull request Feb 11, 2020
Changes the misleading error message when attempting to open
a job while the "cluster.persistent_tasks.allocation.enable"
setting is set to "none" to a clearer message that names the
setting.

Closes #51956
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] Inform user when persistent task allocation is disabled when creating or executing jobs
4 participants