How Elasticsearch co-ordinating node handles RestClient timeouts?

We are using ES 6.0.
We use HighLevelRest client to talk to ES for search requests with socket timeout(as described here https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_timeouts.html) set to 500ms.
My question is when the client times out, what happen to the ongoing query on server(which might be in the request queue OR under execution). Is the query cancelled to free the resources OR does the query runs till completion?

In 6.0 the query runs to completion. In 7.4 and later the query is cancelled when the client connection closes.

1 Like