# \[7.10.1\] Elasticsearch java client InterruptedException

**URL:** <https://discuss.elastic.co/t/7-10-1-elasticsearch-java-client-interruptedexception/312389>\
**Category:** Elasticsearch\
**Created:** [August 18, 2022, 1:05pm UTC](https://discuss.elastic.co/t/7-10-1-elasticsearch-java-client-interruptedexception/312389 "2022-08-18T13:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiago123789](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago123789/32/109871_2.png) [@thiago123789](https://discuss.elastic.co/u/thiago123789)\
**Post date:** [August 18, 2022, 1:05pm UTC](https://discuss.elastic.co/t/7-10-1-elasticsearch-java-client-interruptedexception/312389/1 "2022-08-18T13:05:07Z")

</div>

I am using elasticsearch-rest-client version 7.10.1 with spring boot actuator to provide health check but sometimes elasticsearch is returning a null value with InterruptedException in a Future on RestClient.

```auto
Caused by: java.lang.InterruptedException: null
	at java.base/java.lang.Object.wait(Native Method)
	at java.base/java.lang.Object.wait(Object.java:328)
	at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:82)
	at org.apache.http.impl.nio.client.FutureWrapper.get(FutureWrapper.java:70)
	at org.elasticsearch.client.RestClient.performRequest(RestClient.java:279)
	... 98 common frames omitted

```

Seems to me that elastic client is trying to get an information from an interrupted promise.

```auto
...
private Response performRequest(final NodeTuple<Iterator<Node>> nodeTuple,
                                    final InternalRequest request,
                                    Exception previousException) throws IOException {
        RequestContext context = request.createContextForNextAttempt(nodeTuple.nodes.next(), nodeTuple.authCache);
        HttpResponse httpResponse;
        try {
            httpResponse = client.execute(context.requestProducer, context.asyncResponseConsumer, context.context, null).get();
        } catch(Exception e) {
            ...
        }
        ...
}
...

```

This is causing the health check to failure and making kubernetes keep restarting the pods.

Someone has the same problem ? and workaround or a solution ?

---

<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 15, 2022, 1:05pm UTC](https://discuss.elastic.co/t/7-10-1-elasticsearch-java-client-interruptedexception/312389/2 "2022-09-15T13:05:48Z")

</div>

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