pan3793 commented on code in PR #3379:
URL: https://github.com/apache/hive/pull/3379#discussion_r902398221
##########
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java:
##########
@@ -1329,21 +1328,32 @@ private String getSessionValue(String varName, String
varDefault) {
return varValue;
}
- // use socketTimeout from jdbc connection url. Thrift timeout needs to be in
millis
- private void setupLoginTimeout() {
- String socketTimeoutStr =
sessConfMap.getOrDefault(JdbcConnectionParams.SOCKET_TIMEOUT, "0");
- long timeOut = 0;
- try {
- timeOut = Long.parseLong(socketTimeoutStr);
- } catch (NumberFormatException e) {
- LOG.info("Failed to parse socketTimeout of value " + socketTimeoutStr);
- }
- if (timeOut > Integer.MAX_VALUE) {
- loginTimeout = Integer.MAX_VALUE;
- } else if (timeOut < 0) {
- loginTimeout = 0;
+ // For loginTimeout, prefer to use loginTimeout (in milliseconds) from jdbc
connection url, and
+ // fallback to use DriverManger#getLoginTimeout (in seconds).
+ // For socketTimeout, use socketTimeout (in milliseconds) from jdbc
connection url if present.
+ private void setupTimeout() {
+ long _loginTimeout = 0;
Review Comment:
Any suggestions here? What about use `loginTimeout` and use
`this.loginTimeout` to ref member variable?
--
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]