# Rest High Level Client (5.6.0) stop async threads

**URL:** <https://discuss.elastic.co/t/rest-high-level-client-5-6-0-stop-async-threads/105101>\
**Category:** Elasticsearch\
**Created:** [October 24, 2017, 4:41pm UTC](https://discuss.elastic.co/t/rest-high-level-client-5-6-0-stop-async-threads/105101 "2017-10-24T16:41:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ry99](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@ry99](https://discuss.elastic.co/u/ry99)\
**Post date:** [October 24, 2017, 4:41pm UTC](https://discuss.elastic.co/t/rest-high-level-client-5-6-0-stop-async-threads/105101/1 "2017-10-24T16:41:20Z")

</div>

Hi All,  
I'm just getting started with the Rest High Level Client (5.6.0), and I'm having trouble shutting down my tomcat (8.5) instance because of unhandled threads. I _think_ it's related to the async IO threads for the HTTP connections, but I can't figure out how to stop them. I was hoping for a client.close() function or something, but so far, no dice.

How do I stop dispose of the client and free it's resources once I'm through using it?

ry

---

<div class="post-metadata">

**Author:** ![ry99](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@ry99](https://discuss.elastic.co/u/ry99)\
**Post date:** [October 25, 2017, 7:55pm UTC](https://discuss.elastic.co/t/rest-high-level-client-5-6-0-stop-async-threads/105101/2 "2017-10-25T19:55:17Z")

</div>

I've stumbled upon a workaround: keep a handle to the RestClient used to create the High Level Client, and close that when done. This seems to be working for me.

---

<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:** [November 22, 2017, 7:55pm UTC](https://discuss.elastic.co/t/rest-high-level-client-5-6-0-stop-async-threads/105101/3 "2017-11-22T19:55:30Z")

</div>

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