You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ma...@apache.org on 2015/12/11 03:43:59 UTC

[21/52] [abbrv] phoenix git commit: PHOENIX-2461 Tweak shutdown of ConnectionQueryService during testing

PHOENIX-2461 Tweak shutdown of ConnectionQueryService during testing


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

Branch: refs/heads/calcite
Commit: f237982bfc0fd04c82e5aa2f340659ebdca2619e
Parents: 33ed7d9
Author: James Taylor <jt...@salesforce.com>
Authored: Sun Nov 29 14:05:37 2015 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Sun Nov 29 14:05:37 2015 -0800

----------------------------------------------------------------------
 .../test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f237982b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java
index 2591886..c8928cc 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.jdbc;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.Properties;
+import java.util.concurrent.ThreadPoolExecutor;
 
 import javax.annotation.concurrent.GuardedBy;
 import javax.annotation.concurrent.ThreadSafe;
@@ -109,11 +110,13 @@ public class PhoenixTestDriver extends PhoenixEmbeddedDriver {
         }
         closed = true;
         try {
-            connectionQueryServices.close();
+            if (connectionQueryServices != null) connectionQueryServices.close();
         } finally {
+            ThreadPoolExecutor executor = queryServices.getExecutor();
             try {
                 queryServices.close();
             } finally {
+                if (executor != null) executor.shutdown();
                 connectionQueryServices = null;
             }
         }