-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 9.3
-
Component/s: Elasticsearch
-
Release Notes Summary:Elasticsearch RestClient uses a bigger connection timeout
-
Sprint:nxcore 9.10.2, nxcore 10.1.1, nxAI Sprint 11.1.8
-
Story Points:1
Default connection timeout for Rest client is 5s, this is too short for reindexing repository with a bucket of 500 documents.
For instance:
2017-11-23 19:01:31,829 ERROR [Nuxeo-Work-elasticSearchIndexing-4:18851677441043422.1576402569] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: BucketIndexingWorker(313a1135-6cb8-4288-8772-e86e33f6cd0e..., /elasticSearchIndexing:18851676510800110.1527082810, Progress(?%, ?/0), null) org.nuxeo.ecm.core.api.NuxeoException: java.io.IOException: listener timeout after waiting for [5000] ms at org.nuxeo.elasticsearch.client.ESRestClient.bulk(ESRestClient.java:326) at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.sendBulkCommand(ElasticSearchIndexingImpl.java:210) at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processBulkIndexCommands(ElasticSearchIndexingImpl.java:190) at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:145) at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:400) at org.nuxeo.elasticsearch.work.BucketIndexingWorker.doWork(BucketIndexingWorker.java:78) at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48) at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:379) at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:338) at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: listener timeout after waiting for [5000] ms at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:660) at org.elasticsearch.client.RestClient.performRequest(RestClient.java:219) at org.elasticsearch.client.RestClient.performRequest(RestClient.java:191) at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:396) at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:382) at org.elasticsearch.client.RestHighLevelClient.bulk(RestHighLevelClient.java:197) at org.nuxeo.elasticsearch.client.ESRestClient.bulk(ESRestClient.java:324) ... 12 more
This can be fixed by adding options in the elasticsearch contribution (default to templates/common-base/nxserver/config/elasticsearch-config.xml.nxftl)
<elasticSearchClient class="org.nuxeo.elasticsearch.client.ESRestClientFactory"> <option name="addressList">${elasticsearch.addressList}</option> <option name="connection.timeout.ms">30000</option> <option name="socket.timeout.ms">40000</option> </elasticSearchClient>
we should make this options accessible from nuxeo.conf and use higher value by default.