Restclient fails with concurrent.TimeoutException Exception

Indexing is failing with following exception . I am using Elastic Search REST client 5.6.4 and Elastic Server 5.6.4.
I saw a similar post , but no resolution given . can i get some pointers ?

Caused by: java.util.concurrent.TimeoutException
at org.apache.apache.http.nio.pool.AbstractNIOConnPool.processPendingRequest(AbstractNIOConnPool.java:375)
at org.apache.apache.http.nio.pool.AbstractNIOConnPool.lease(AbstractNIOConnPool.java:277)
at org.apache.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.requestConnection(PoolingNHttpClientConnectionManager.java:268)
at org.apache.apache.http.impl.nio.client.AbstractClientExchangeHandler.requestConnection(AbstractClientExchangeHandler.java:377)
at org.apache.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.start(DefaultClientExchangeHandlerImpl.java:129)
at org.apache.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:141)
at org.apache.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:343)
at org.apache.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:325)
at org.apache.elasticsearch.client.RestClient.performRequest(RestClient.java:218)

Hi Vyas,

Can you post the relevant part of our code (initialization and index operation)? That would help someone to try to figure out what's happening.

Also, can you check if you are connecting in the elasticsearch port (default 9200)?

Cheers,
LG

Hi Luiz

we initialize rest (Singleton) rest client,

public static Client getRestClient() {
ADFContext context = ADFContext.getCurrent();
if (context != null) {
Map<String, Object> applicationScope = context.getApplicationScope()
Client client = (Client)applicationScope.get(REST_CLIENT_CACHE_KEY);
if (client == null) {
client = cacheRestClient(applicationScope);
}
return client;
}
return null;
}

yes we use default port , 9200.

Hi Vyas,

I didn't get your point precisely. I have one example on how to initialize the low level REST client and perform one index operation in my gist.

Does it work for you?

Also, you can find more detailed information in this doc page.

Cheers,
LG

Ok , this is what i am doing . No timeout parameters are changed.

public static Client getRestClient(HttpHost host) {
RestClientBuilder builder = RestClient.builder(host);
builder.setDefaultHeaders(EMPTY_HEADERS);
return new Client(builder.build(), host);
}
Note: Above exception is consistent seen all the them time. And we have only 1 Node.

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