Specific timeout for forcemerge request


I'm using 'sync' force-merge request after bulk-indexing of large data set (230 millions documents).
The client timeouts after 10 mins:
java.net.SocketTimeoutException: 600,000 milliseconds timeout on connection http-outgoing-0

I'm using ES Java client (7.6.1), code:

ForceMergeRequest request = new ForceMergeRequest();
client.indices().forcemerge(request, RequestOptions.DEFAULT);

Is there an option to overwrite the "global socket timeout" specifically for forcemerge request?
Let say I would use 30 minutes for forcemerge and 1 minute for the rest?


The client re-uses HTTP connections for multiple requests which I think prevents us from changing the socket timeout on a per-request basis.

You can, however, make a different client just for force-merging and use RestClientBuilder#setRequestConfigCallback to adjust its timeout.

1 Like

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