drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [05/27] git commit: DRILL-1090: Shutdown Drillbit if start-up fails
Date Sun, 27 Jul 2014 18:46:51 GMT
DRILL-1090: Shutdown Drillbit if start-up fails


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/015680c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/015680c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/015680c8

Branch: refs/heads/master
Commit: 015680c810dedd12aae3a8135f9fb52af8c65fb6
Parents: 9ed654b
Author: Hanifi Gunes <hgunes@maprtech.com>
Authored: Mon Jul 21 14:08:57 2014 -0700
Committer: Aditya Kishore <aditya@maprtech.com>
Committed: Thu Jul 24 16:16:02 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/drill/exec/server/Drillbit.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/015680c8/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
index 43cc2b9..57e07a0 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/Drillbit.java
@@ -73,6 +73,7 @@ public class Drillbit implements Closeable{
       logger.debug("Starting Drillbit.");
       bit.run();
     } catch (Exception e) {
+      bit.close();
       throw new DrillbitStartupException("Failure during initial startup of Drillbit.", e);
     }
     return bit;
@@ -156,7 +157,7 @@ public class Drillbit implements Closeable{
   }
 
   public void close() {
-    if (coord != null) coord.unregister(handle);
+    if (coord != null && handle != null) coord.unregister(handle);
 
     try {
       Thread.sleep(context.getConfig().getInt(ExecConstants.ZK_REFRESH) * 2);
@@ -168,6 +169,11 @@ public class Drillbit implements Closeable{
     } catch (Exception e) {
       logger.warn("Failure while shutting down embedded jetty server.");
     }
+    try {
+      cache.close();
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
     Closeables.closeQuietly(engine);
     Closeables.closeQuietly(storeProvider);
     Closeables.closeQuietly(coord);


Mime
View raw message