diff --git a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java index ec9c1932e5..7c88e6ba22 100644 --- a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java +++ b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java @@ -298,6 +298,7 @@ public HiveConnection(String uri, Properties info) throws SQLException { executeInitSql(); } else { int maxRetries = 1; + int sleepMs = 1000; try { String strRetries = sessConfMap.get(JdbcConnectionParams.RETRIES); if (StringUtils.isNotBlank(strRetries)) { @@ -343,7 +344,12 @@ public HiveConnection(String uri, Properties info) throws SQLException { if (numRetries >= maxRetries) { throw new SQLException(errMsg + e.getMessage(), " 08S01", e); } else { - LOG.warn(warnMsg + e.getMessage() + " Retrying " + numRetries + " of " + maxRetries); + LOG.warn(warnMsg + e.getMessage() + " Retrying " + numRetries + " of " + maxRetries +" with retry interval "+sleepMs+"ms"); + try { + Thread.sleep(sleepMs); + } catch (InterruptedException ex) { + //Ignore + } } } }