You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/07/15 07:20:45 UTC

[GitHub] [hive] pan3793 commented on pull request #3379: [HIVE-26336] Hive JDBC Driver should respect JDBC DriverManager#loginTimeout

pan3793 commented on PR #3379:
URL: https://github.com/apache/hive/pull/3379#issuecomment-1185254554

   > Introduce new JDBC parameter `connectTimeout` w/ exsiting `socketTimeout`, ignore `DriverManager.loginTimeout`
   
   Implement it as we discussed before, but I found it not easy to add integration tests.
   
   The following tests are what I want to add at first, but finally, I realized it does not make sense, because JDBC always runs in async mode, a "sleep" query will not block server return the response immediately.
   
   ```
   @Test(expected = SocketTimeoutException.class)
     public void testThrowSocketTimeoutException() throws Exception {
       String url = miniHS2.getJdbcURL("default", "socketTimeout=5000");
       try (HiveConnection conn = (HiveConnection) DriverManager.getConnection(url)) {
         try (Statement stmt = conn.createStatement()) {
           stmt.executeQuery("SELECT reflect('java.lang.Thread', 'sleep', bigint(6000))");
         }
       }
     }
   
     @Test
     public void testConnectTimeoutDoesNotAffectSocketTime() throws Exception {
       String url = miniHS2.getJdbcURL("default", "connectTimeout=5000");
       try (HiveConnection conn = (HiveConnection) DriverManager.getConnection(url)) {
         try (Statement stmt = conn.createStatement()) {
           stmt.executeQuery("SELECT reflect('java.lang.Thread', 'sleep', bigint(6000))");
         }
       }
     }
   ```


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org