Skip to content

[ES|QL] When requesting GET /_query/async/{id}?keep_alive={time} while the query is running keep_alive is ignored #135169

@kertal

Description

@kertal

Elasticsearch Version

main

Installed Plugins

No response

Java Version

bundled

OS Version

MacOs 15.6.1

Problem Description

When requesting async ESQL query results using

GET /_query/async/{id}?keep_alive={time}

While there query is still running, the new value of keep_alive doesn't prevent the query to 404 after the initial keep_alive time that was set

Steps to Reproduce

Start a query with a given DELAY to make sure it's running while you use the GET API

POST /_query/async?drop_null_columns
{
   "wait_for_completion_timeout":"200ms",
   "keep_on_completion":true,
   "keep_alive":"10000ms",
   "query":"FROM kibana_sample_data_ecommerce | EVAL delay = DELAY(20000ms) | LIMIT 1",
   "locale":"en",
   "include_ccs_metadata":true
}

Use the id of the query to increase the intended keep_alive value

GET /_query/async/{id}?keep_alive=1500000ms

Then use the following request to get the results of a query, request it after roughly 30s or a little bit more, after the query returned results and the keep_alive period is over

GET /_query/async/{id}

then the request will return a 404, because the resource with the actual id as been cleaned up.

Expected result should be that the keep_alive can be extended also in the running state, like it works in DSL

Logs (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions