You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2023/02/02 07:29:41 UTC

[kyuubi] branch master updated: [KYUUBI #4224] Enlarge REST client default timeout

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 58e9dd1e7 [KYUUBI #4224] Enlarge REST client default timeout
58e9dd1e7 is described below

commit 58e9dd1e7702632fca14a62713f32b8f02b9ae0a
Author: Cheng Pan <ch...@apache.org>
AuthorDate: Thu Feb 2 15:29:32 2023 +0800

    [KYUUBI #4224] Enlarge REST client default timeout
    
    ### _Why are the changes needed?_
    
    The current default socket timeout is set to 3s, which is too short, when Kyuubi Server is busy, e.g. during GC, the client will fail w/ socket read timeout after 3s if no bytes are returned in the socket.
    
    This PR proposes to enlarge the REST client default timeout
    
    - connect timeout from 3s to 30s
    - socket timeout from 3s to 2min
    - attempt interval keep 3s
    
    They keep consistent w/ `org.apache.kyuubi.ctl.CtlConf`
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4224 from pan3793/rest-timeout.
    
    Closes #4224
    
    0db2a3788 [Cheng Pan] nit
    01fa50942 [Cheng Pan] Enlarge REST client default timeout
    
    Authored-by: Cheng Pan <ch...@apache.org>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../src/main/java/org/apache/kyuubi/client/KyuubiRestClient.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/KyuubiRestClient.java b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/KyuubiRestClient.java
index a6079e9e0..dbcc89b16 100644
--- a/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/KyuubiRestClient.java
+++ b/kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/KyuubiRestClient.java
@@ -165,13 +165,16 @@ public class KyuubiRestClient implements AutoCloseable, Cloneable {
 
     private String password;
 
-    private int socketTimeout = 3000;
+    // 2 minutes
+    private int socketTimeout = 2 * 60 * 1000;
 
-    private int connectTimeout = 3000;
+    // 30s
+    private int connectTimeout = 30 * 1000;
 
     private int maxAttempts = 3;
 
-    private int attemptWaitTime = 3000;
+    // 3s
+    private int attemptWaitTime = 3 * 1000;
 
     public Builder(String hostUrl) {
       if (StringUtils.isBlank(hostUrl)) {