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] Detect timeout when waiting for download task #103197

Merged
merged 6 commits into from
Jan 15, 2024

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented Dec 8, 2023

When starting a model deployment there is a check the a download task is in progress for that model id. This check is called with wait_for_completion: true and a timeout of 30 seconds so that the start might wait for the download to finish.

The problem is that if the download task is present but does not complete in 30 seconds it would appear there was no task.

ListTasksResponse is a BaseTasksResponse, for these types of responses the node and task exceptions should be checked. When the request times out waiting for a task to complete there are no tasks in the response but there is a node exception with the timeout. The change here is to check for that timeout and return a descriptive error message.

The failing test from #103153 is now called with a 1 second timeout as there is no point waiting 30 seconds for the test to fail. The intermittent failures were occurred when the model download did not complete in the default timeout period of 30s so the full model definition was not present.

Closes #103153

@davidkyle davidkyle added >test Issues or PRs that are addressing/adding tests :ml Machine learning auto-backport-and-merge v8.12.0 v8.13.0 labels Dec 8, 2023
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Dec 8, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@davidkyle davidkyle changed the title [ML] No wait when checking for download task [ML] Detect timeout when waiting for download task Dec 8, 2023
# Conflicts:
#	x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/TaskRetriever.java
@davidkyle
Copy link
Member Author

run elasticsearch-ci/part-4

2 similar comments
@davidkyle
Copy link
Member Author

run elasticsearch-ci/part-4

@davidkyle
Copy link
Member Author

run elasticsearch-ci/part-4

Copy link
Member

@maxhniebergall maxhniebergall left a comment

Choose a reason for hiding this comment

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

LGTM

@maxhniebergall maxhniebergall marked this pull request as draft December 27, 2023 20:46
@davidkyle
Copy link
Member Author

@elasticmachine update branch

@davidkyle
Copy link
Member Author

@elasticmachine update branch

@davidkyle davidkyle marked this pull request as ready for review January 15, 2024 13:12
@davidkyle davidkyle added v8.12.1 and removed v8.12.0 labels Jan 15, 2024
@davidkyle davidkyle merged commit 6f2c036 into elastic:main Jan 15, 2024
15 checks passed
@davidkyle davidkyle deleted the no-wait-on-download-check branch January 15, 2024 14:12
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.12 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 103197

davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Jan 15, 2024
A list tasks timeout indicates the task exists and is in progress.
Interpreting the timeout as the task not existing meant the download
check would incorrectly assume the download had completed.
# Conflicts:
#	x-pack/plugin/ml-package-loader/src/main/java/org/elasticsearch/xpack/ml/packageloader/action/TransportLoadTrainedModelPackage.java
#	x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/3rd_party_deployment.yml
elasticsearchmachine pushed a commit that referenced this pull request Jan 15, 2024
A list tasks timeout indicates the task exists and is in progress.
Interpreting the timeout as the task not existing meant the download
check would incorrectly assume the download had completed.
# Conflicts:
#	x-pack/plugin/ml-package-loader/src/main/java/org/elasticsearch/xpack/ml/packageloader/action/TransportLoadTrainedModelPackage.java
#	x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/3rd_party_deployment.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport pending :ml Machine learning Team:ML Meta label for the ML team >test Issues or PRs that are addressing/adding tests v8.12.1 v8.13.0
Projects
None yet
5 participants