ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject ambari git commit: AMBARI-12213. After a timeout, hive connection is stale (Erik Bergenholtz via rlevas)
Date Thu, 02 Jul 2015 15:13:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 260d9d46a -> 260ebef0d


AMBARI-12213. After a timeout, hive connection is stale (Erik Bergenholtz via rlevas)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/260ebef0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/260ebef0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/260ebef0

Branch: refs/heads/trunk
Commit: 260ebef0d1f9d810a346d4e51263e4c9391a7086
Parents: 260d9d4
Author: Erik Bergenholtz <ebergenholtz@hortonworks.com>
Authored: Thu Jul 2 11:13:40 2015 -0400
Committer: Robert Levas <rlevas@hortonworks.com>
Committed: Thu Jul 2 11:13:40 2015 -0400

----------------------------------------------------------------------
 .../org/apache/ambari/view/hive/client/HiveCall.java    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/260ebef0/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/HiveCall.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/HiveCall.java
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/HiveCall.java
index c8b43e2..1b565eb 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/HiveCall.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/HiveCall.java
@@ -43,9 +43,19 @@ public abstract class HiveCall <T> {
       if (needRetry) {
         needRetry = false;
         attempts += 1;
-        conn.closeConnection();
+        try {
+          conn.closeConnection();
+        } catch (Exception e) {
+          LOG.error("Connection closed with error", e);
+        }
+      }
+
+      if (conn.getClient() == null) {
+        // previous attempt closed the connection, but new was failed to be established.
+        // on new call trying to open the connection again.
         conn.openConnection();
       }
+
       try {
 
         synchronized (conn) {


Mime
View raw message