How to avoid 30,000ms timeout during reindexing

While performing reindex operation, I am setting the request timeout to be 60 mins as below

request.setTimeout(TimeValue. timeValueMinutes (60));

With the above config in place my request is still timing out for 30,000 ms. How can I avoid the below error 30,000 milliseconds timeout on connection http-outgoing-0

After debugging enough, Came to know that socketTimeout should be set during client creation time and request timeout is something completely different from socketTimeout.

I started setting socketTimeout as below and worked fine.

return new RestHighLevelClient( RestClient.builder( HttpHost
                                                            .create( elasticSearchConfig().getEndPoint() ) )
                                        .setHttpClientConfigCallback( hacb -> hacb.addInterceptorLast( interceptor ) ) 
                                        .setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(elasticSearchConfig().getClientConnectionTimeout())

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