deniskuzZ commented on code in PR #5683:
URL: https://github.com/apache/hive/pull/5683#discussion_r2009069794
##########
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java:
##########
@@ -1433,20 +1434,23 @@ private String getSessionValue(String varName, String
varDefault) {
}
// use socketTimeout from jdbc connection url. Thrift timeout needs to be in
millis
- private void setupLoginTimeout() {
+ private void setupTimeout() {
+ String connectTimeoutStr =
sessConfMap.getOrDefault(JdbcConnectionParams.CONNECT_TIMEOUT, "0");
String socketTimeoutStr =
sessConfMap.getOrDefault(JdbcConnectionParams.SOCKET_TIMEOUT, "0");
- long timeOut = 0;
+ long connectTimeoutMs = 0;
+ long socketTimeoutMs = 0;
try {
- timeOut = Long.parseLong(socketTimeoutStr);
+ connectTimeoutMs = Long.parseLong(connectTimeoutStr);
+ connectTimeout = (int) Math.max(0, Math.min(connectTimeoutMs,
Integer.MAX_VALUE));
} catch (NumberFormatException e) {
- LOG.info("Failed to parse socketTimeout of value " + socketTimeoutStr);
+ LOG.info("Failed to parse connectTimeout of value " + connectTimeoutStr);
}
- if (timeOut > Integer.MAX_VALUE) {
- loginTimeout = Integer.MAX_VALUE;
- } else if (timeOut < 0) {
- loginTimeout = 0;
- } else {
- loginTimeout = (int) timeOut;
+
+ try {
+ socketTimeoutMs = Long.parseLong(socketTimeoutStr);
+ connectTimeout = (int) Math.max(0, Math.min(socketTimeoutMs,
Integer.MAX_VALUE));
Review Comment:
that seems wrong
--
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]