Menu

30 000 milliseconds timeout on connection http-outgoing-0 [active] | Elasticsearch

Elasticsearch connection timeout issue description:

While using the Bulk API in Elasticsearch we encounter the Timeout error java.net.SocketTimeoutException: 30,000 milliseconds timeout on connection http-outgoing-0 [ACTIVE] due to a huge file with thousands of records. 

We face this issue while creating or updating the Elasticsearch indices in bulk, and trying to upload the huge file with thousands of records.

Default timeout of the Elascticsearch Bulk API request is 30 seconds.

Elasticsearch connection timeout resolution:

If you are using the BulkRequest [org.elasticsearch.action.bulk.BulkRequest] then use the below line to add the request timeout in minutes.

request.timeout(TimeValue.timeValueMinutes(10));

If you are using RestClient [org.elasticsearch.client.RestClient] to submit the request then use the below line of code to set the timeout.

RestClient.setMaxRetryTimeoutMillis(100000);

The above statement will set the request timeout to 100 seconds.


Hope this helps you!


References:

Elastic Search Bulk API

RestClient Implementation doc

No comments:

Post a Comment