# java.io.IOException: listener timeout after waiting for \[90000\] ms

**URL:** https://discuss.elastic.co/t/java-io-ioexception-listener-timeout-after-waiting-for-90000-ms/245153
**Category:** Elasticsearch
**Created:** [August 16, 2020, 3:50pm UTC](https://discuss.elastic.co/t/java-io-ioexception-listener-timeout-after-waiting-for-90000-ms/245153 "2020-08-16T15:50:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![itaydvir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itaydvir/32/10143_2.png) [@itaydvir](https://discuss.elastic.co/u/itaydvir)
#### Post date: [August 16, 2020, 3:50pm UTC](https://discuss.elastic.co/t/java-io-ioexception-listener-timeout-after-waiting-for-90000-ms/245153/1 "2020-08-16T15:50:20Z")

</div>

Hello,  
I've upgraded to version 6.8 and using java `RestHighLevelClient`.  
Cluster is behind SearchGuard plugin and usually everything is working well.  
Sometimes (I assume when there are some network issues) i'm getting errors `java.io.IOException: listener timeout after waiting for [90000] ms` even tho i set timeout of 3 seconds:

```auto
    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
    searchSourceBuilder.size(0);
    searchSourceBuilder.timeout(TimeValue.timeValueSeconds(3));

    SearchRequest searchRequest = new SearchRequest(indexName);
    searchRequest.types("_doc");
    searchRequest.searchType(SearchType.QUERY_THEN_FETCH);
    searchRequest.source(searchSourceBuilder);

    SearchResponse response = client().search(searchRequest, RequestOptions.DEFAULT);

```

Due to the 90000ms timeout, all threads become busy, and app is chocking.  
So I have few questions:

1. why default listener timeout is set to 90000 ms? what is the reason for such high timeout? what should I consider if I want to lower it (lets say to 10000)?
2. why its not throwing an exception after the 3 sec timeout i set in code above?
3. how do you suggest to avoid such issues? will sniffer solve it?

Thanks!

---

<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: [September 13, 2020, 3:50pm UTC](https://discuss.elastic.co/t/java-io-ioexception-listener-timeout-after-waiting-for-90000-ms/245153/2 "2020-09-13T15:50:20Z")

</div>

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