[7.10.1] Elasticsearch java client InterruptedException

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.

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.

...
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 ?

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