fbertsch commented on code in PR #7300:
URL: https://github.com/apache/kyuubi/pull/7300#discussion_r2769250390


##########
python/pyhive/hive.py:
##########
@@ -236,6 +240,8 @@ def __init__(
             if auth is None:
                 auth = 'NONE'
             socket = thrift.transport.TSocket.TSocket(host, port)
+            if connection_timeout:
+                socket.setTimeout(connection_timeout)

Review Comment:
   FYI this sets both connection and socket timeout. There's a nice description 
of the difference 
[here](https://stackoverflow.com/questions/7360520/connectiontimeout-versus-sockettimeout).
   ```suggestion
                   socket. setConnectTimeout(connection_timeout)
   ```



##########
python/pyhive/hive.py:
##########
@@ -236,6 +240,8 @@ def __init__(
             if auth is None:
                 auth = 'NONE'
             socket = thrift.transport.TSocket.TSocket(host, port)
+            if connection_timeout:

Review Comment:
   This will not set the timeout if it's equal to 0, but that is [interpreted 
by the underlying Socket class as an "infinite wait" 
duration](https://docs.oracle.com/javase/8/docs/api/java/net/Socket.html#connect-java.net.SocketAddress-int-).
 It might be worth letting users set this to 0
   ```suggestion
               if connection_timeout is not None:
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to