ILuffZhe commented on a change in pull request #2659:
URL: https://github.com/apache/calcite/pull/2659#discussion_r775104362



##########
File path: 
elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java
##########
@@ -197,7 +197,11 @@ RestClient restClient() {
       return client;
     }
 
-    final RestClient client = RestClient.builder(httpHost()).build();
+    final RestClient client = RestClient.builder(httpHost())
+        .setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder
+            .setConnectTimeout(60 * 1000)  // default 1000
+            .setSocketTimeout(3 * 60 * 1000))  // default 30000
+        .build();

Review comment:
       (1) I’ve checked some CI tests, where I find tests running time for 
Elasticsearch:test **ranges from 18s to 60s**, it’s hard to determine a perfect 
timeout value for RestClient due to the network bandwidth and resources 
fluctuations. In our own project, we set those two timeout for 60s and 180s 
based on experience and actual use.
   (2) As for timeout tests, I’ve debug this several times by setting 
socketTimeout to 1, and “1 milliseconds timeout on connection 
http-outgoing-0”(exception msg changed when you set different timeout) occurred 
when timeout reached. So, it's working.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to