phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject phoenix git commit: PHOENIX-4041 CoprocessorHConnectionTableFactory should not open a new HConnection when shutting down
Date Wed, 19 Jul 2017 18:49:14 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.11-HBase-0.98 b1c90d969 -> 9034413bd


PHOENIX-4041 CoprocessorHConnectionTableFactory should not open a new HConnection when shutting
down


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/9034413b
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/9034413b
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/9034413b

Branch: refs/heads/4.11-HBase-0.98
Commit: 9034413bdd2612bd577fb1de2f07cce4f1752866
Parents: b1c90d9
Author: Samarth Jain <samarth@apache.org>
Authored: Wed Jul 19 11:49:03 2017 -0700
Committer: Samarth Jain <samarth@apache.org>
Committed: Wed Jul 19 11:49:03 2017 -0700

----------------------------------------------------------------------
 .../phoenix/hbase/index/write/IndexWriterUtils.java       | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9034413b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriterUtils.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriterUtils.java
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriterUtils.java
index ea4ec1a..a82b277 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriterUtils.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/write/IndexWriterUtils.java
@@ -121,11 +121,13 @@ public class IndexWriterUtils {
         }
 
         @Override
-        public void shutdown() {
+        public synchronized void shutdown() {
             try {
-                getConnection(conf).close();
-            } catch (IOException e) {
-                LOG.error("Exception caught while trying to close the HConnection used by
CoprocessorHConnectionTableFactory");
+                if (connection != null && !connection.isClosed()) {
+                    connection.close();
+                }
+            } catch (Throwable e) {
+                LOG.warn("Error while trying to close the HConnection used by CoprocessorHConnectionTableFactory",
e);
             }
         }
 


Mime
View raw message