Repository: phoenix
Updated Branches:
  refs/heads/4.11-HBase-1.3 fbf8e7b44 -> 971869403


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/97186940
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/97186940
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/97186940

Branch: refs/heads/4.11-HBase-1.3
Commit: 9718694037da49c2a8afb71c9d6ed1f4f27255a9
Parents: fbf8e7b
Author: Samarth Jain <[email protected]>
Authored: Wed Jul 19 11:50:23 2017 -0700
Committer: Samarth Jain <[email protected]>
Committed: Wed Jul 19 11:50:23 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/97186940/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);
             }
         }
 

Reply via email to