elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.38k stars 24.55k forks source link

[ML] Associate text_expansion subsearch with parent search request #107077

Open prwhelan opened 5 months ago

prwhelan commented 5 months ago

Description

A text_expansion subsearch is hardcoded to time out after 10s, ignoring any timeout configured in the parent search task.

For example:

GET kibana_sample_data_logs/_search
{
  "timeout": "30s",
  "query": {
    "text_expansion": {
      "message": {
        "model_id": ".elser_model_2",
        "model_text": "the query string"
      }
    }
  }
}

If the text_expansion takes longer than 10s, it will time out and throw an error, ignoring the 30s configuration.

Options:

  1. Pass the configured timeout value from the parent search to the subsearches: https://github.com/prwhelan/elasticsearch/commit/241296daa30a2bac63aa1ee59bc9c745afef2433
  2. Associate the subsearch task with the parent task and remove the hardcoded timeout from the test_expansion task. When the parent task is canceled, all children will be canceled.
elasticsearchmachine commented 5 months ago

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