Socket timeout during reindexAsync in RestHighLevelClient

Hi,
I have the problem with reindexing my documents, I have index with 900K documents but RestHighLevelClient always returns java.net.SocketTimeoutException, I increase the socket timeout, set the batch size to 500 but still problem occurs. How I should resolve this problem ?
my code looks like

 public Mono<BulkByScrollResponse> reindex(String sourceIndex, String destIndex) {

    ReindexRequest request = new ReindexRequest();
    request.setSourceIndices(sourceIndex);
    request.setDestIndex(destIndex);
    request.setSourceBatchSize(500);

    return Mono.create(
        sink ->
            elasticClient
                .reindexAsync(request, RequestOptions.DEFAULT, listenerToSink(sink)));
  }

Is this socket opened each batch or it waits to the end of reindexing? I add also more slices but this didn't solve the issue. My documents are pretty simple, just 15 text fields (< 30 signs)

Hi @Dawid_Macura,

using reindex or reindexAsync, it is likely that the entire reindex request need to complete within the socket timeout. The request is sent in its entirety to the server and thus batching does not interact with socket timeout here.

You can use submitReindexTask instead, which will return information about the started task that you can then use task().get(...) to interrogate.

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