# How Elasticsearch co-ordinating node handles RestClient timeouts?

**URL:** <https://discuss.elastic.co/t/how-elasticsearch-co-ordinating-node-handles-restclient-timeouts/224669>\
**Category:** Elasticsearch\
**Created:** [March 23, 2020, 12:02pm UTC](https://discuss.elastic.co/t/how-elasticsearch-co-ordinating-node-handles-restclient-timeouts/224669 "2020-03-23T12:02:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![the123saurav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the123saurav/32/47551_2.png) [@the123saurav](https://discuss.elastic.co/u/the123saurav)\
**Post date:** [March 23, 2020, 12:02pm UTC](https://discuss.elastic.co/t/how-elasticsearch-co-ordinating-node-handles-restclient-timeouts/224669/1 "2020-03-23T12:02:31Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 23, 2020, 12:50pm UTC](https://discuss.elastic.co/t/how-elasticsearch-co-ordinating-node-handles-restclient-timeouts/224669/2 "2020-03-23T12:50:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 20, 2020, 12:50pm UTC](https://discuss.elastic.co/t/how-elasticsearch-co-ordinating-node-handles-restclient-timeouts/224669/3 "2020-04-20T12:50:38Z")

</div>

Closed on April 20, 2020, 12:50pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
