Skip to content

[ES|QL] When requesting GET /_query/async/{id}?keep_alive={time} keep_alive is ignored #130619

@kertal

Description

@kertal

Elasticsearch Version

main

Installed Plugins

No response

Java Version

bundled

OS Version

MacOS 15.5

Problem Description

When requesting async ESQL query results using

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

The new value of keep_alive doesn't prevent the query to 404 after the initial keep_alive time that was set

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-get

Our docs just mention

Values are -1 or 0

But I assume we can set time strings like in the initial POST request? The documentation here mentions:

keep_alive STRING A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. 

Anyhow, it doesn't seem to work, whatever value I set to the request during the initial keep_alive timeframe, doesn't keep to query results from being removed.

Steps to Reproduce

Start an async ES|QL query like this

POST /_query/async { "wait_for_completion_timeout":"200s", "keep_alive": "15s", "keep_on_completion": true, "query": """ FROM kibana_sample_data_ecommerce | KEEP order_date, customer_full_name | SORT order_date DESC | LIMIT 10 """ } 

With the id you get, follow up with a second request, you have 15s to do so

GET /_query/async/{id}?keep_alive=60s&drop_null_columns=true

If you wait a bit after the 15s to follow up be repeating same request

GET /_query/async/{id}?keep_alive=60s&drop_null_columns=true

You will get a 404 ... expected result would be that the query would be kept alive for 60s

Note that if 15s seem to be to fast / to slow for you, pls change to a better time range . I struggled with 10s 🚋

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions