[ 
https://issues.apache.org/jira/browse/HIVE-12371?focusedWorklogId=526817&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-526817
 ]

ASF GitHub Bot logged work on HIVE-12371:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Dec/20 13:20
            Start Date: 21/Dec/20 13:20
    Worklog Time Spent: 10m 
      Work Description: dengzhhu653 commented on a change in pull request #1611:
URL: https://github.com/apache/hive/pull/1611#discussion_r546701496



##########
File path: jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
##########
@@ -1002,11 +1002,19 @@ private String getSessionValue(String varName, String 
varDefault) {
     return varValue;
   }
 
-  // copy loginTimeout from driver manager. Thrift timeout needs to be in 
millis
+  // use socketTimeout from jdbc connection url. Thrift timeout needs to be in 
millis
   private void setupLoginTimeout() {
-    long timeOut = TimeUnit.SECONDS.toMillis(DriverManager.getLoginTimeout());
+    String socketTimeoutStr = 
sessConfMap.getOrDefault(JdbcConnectionParams.SOCKET_TIMEOUT, "0");
+    long timeOut = 0;

Review comment:
       Set the default value to 0 may cause problems for those elder clients 
using DriverManager.loginTimeout to prevent the client from hang or return 
quickly if there are some problems in HS2, users have to refactor the uri with 
the socket timeout parameter after applying this.  After all, there are some 
preconditions should be met on the HIVE-22196: 1, There are different drivers 
that created in the same jvm; 2,  One of the driver sets the loginTimeout that 
is inappropriate for others.




----------------------------------------------------------------
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.

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 526817)
    Time Spent: 1.5h  (was: 1h 20m)

> Adding a timeout connection parameter for JDBC
> ----------------------------------------------
>
>                 Key: HIVE-12371
>                 URL: https://issues.apache.org/jira/browse/HIVE-12371
>             Project: Hive
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Nemon Lou
>            Assignee: Xi Chen
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> There are some timeout settings from server side:
> HIVE-4766
> HIVE-6679
> Adding a timeout connection parameter for JDBC is useful in some scenario:
> 1,beeline (which can not set timeout manually)
> 2,customize timeout for different connections (among hive or RDBs,which can 
> not be done via DriverManager.setLoginTimeout())
> Just like postgresql,
> {noformat}
> jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true&connectTimeout=0
> {noformat}
> or mysql
> {noformat}
> jdbc:mysql://xxx.xx.xxx.xxx:3306/database?connectTimeout=60000&socketTimeout=60000
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to