asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Fix Hang At CC Shutdown When NC Has Exited
Date Wed, 31 Aug 2016 03:50:04 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 85a2e39dd -> 3954de1ad


Fix Hang At CC Shutdown When NC Has Exited

Also fix a few mispellings in log mesages:
/UNSABLE/UNUSABLE/
/Recieved/Received/

Change-Id: I6892cfb7b7253b1e0900abaa21705ee06da477d0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1130
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


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

Branch: refs/heads/master
Commit: 3954de1ad4c5cd3d6ac928663bf15a4a47aacaea
Parents: 85a2e39
Author: Michael Blow <mblow@apache.org>
Authored: Tue Aug 30 21:47:06 2016 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Tue Aug 30 20:49:38 2016 -0700

----------------------------------------------------------------------
 .../om/util/AsterixClusterProperties.java       |  2 +-
 .../control/cc/work/ClusterShutdownWork.java    | 21 ++++++++++++++------
 .../control/cc/work/NotifyShutdownWork.java     |  5 +----
 .../control/common/base/INodeController.java    |  2 +-
 .../common/ipc/NodeControllerRemoteProxy.java   |  2 +-
 5 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3954de1a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/util/AsterixClusterProperties.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/util/AsterixClusterProperties.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/util/AsterixClusterProperties.java
index abfcf67..5acf9ae 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/util/AsterixClusterProperties.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/util/AsterixClusterProperties.java
@@ -205,7 +205,7 @@ public class AsterixClusterProperties {
         for (ClusterPartition p : clusterPartitions.values()) {
             if (!p.isActive()) {
                 state = ClusterState.UNUSABLE;
-                LOGGER.info("Cluster is in UNSABLE state");
+                LOGGER.info("Cluster is in UNUSABLE state");
                 return;
             }
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3954de1a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/ClusterShutdownWork.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/ClusterShutdownWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/ClusterShutdownWork.java
index b05a3d6..6acab12 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/ClusterShutdownWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/ClusterShutdownWork.java
@@ -22,6 +22,7 @@ package org.apache.hyracks.control.cc.work;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.hyracks.control.cc.ClusterControllerService;
@@ -60,9 +61,8 @@ public class ClusterShutdownWork extends SynchronizableWork {
             /**
              * Shutdown all the nodes...
              */
-            for (NodeControllerState ncs : nodeControllerStateMap.values()) {
-                ncs.getNodeController().shutDown();
-            }
+            nodeControllerStateMap.forEach(this::shutdownNode);
+
             ccs.getExecutor().execute(new Runnable() {
                 @Override
                 public void run() {
@@ -72,7 +72,7 @@ public class ClusterShutdownWork extends SynchronizableWork {
                          */
                         boolean cleanShutdown = shutdownStatus.waitForCompletion();
                         if (cleanShutdown) {
-                            callback.setValue(new Boolean(true));
+                            callback.setValue(true);
                             ccs.stop();
                             LOGGER.info("JVM Exiting.. Bye!");
                             Runtime rt = Runtime.getRuntime();
@@ -85,10 +85,10 @@ public class ClusterShutdownWork extends SynchronizableWork {
                             LOGGER.severe("Clean shutdown of NCs timed out- CC bailing out!");
                             StringBuilder unresponsive = new StringBuilder();
                             for (String s : shutdownStatus.getRemainingNodes()) {
-                                unresponsive.append(s + " ");
+                                unresponsive.append(s).append(' ');
                             }
                             LOGGER.severe("Unresponsive Nodes: " + unresponsive);
-                            callback.setValue(new Boolean(false));
+                            callback.setValue(false);
                             ccs.stop();
                             LOGGER.info("JVM Exiting.. Bye!");
                             Runtime rt = Runtime.getRuntime();
@@ -103,4 +103,13 @@ public class ClusterShutdownWork extends SynchronizableWork {
             callback.setException(e);
         }
     }
+
+    protected void shutdownNode(String key, NodeControllerState ncState) {
+        try {
+            ncState.getNodeController().shutdown();
+        } catch (Exception e) {
+            LOGGER.log(
+                    Level.INFO, "Exception shutting down NC " + key + " (possibly dead?),
continuing shutdown...", e);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3954de1a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/NotifyShutdownWork.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/NotifyShutdownWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/NotifyShutdownWork.java
index 9e290d6..1efbc6a 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/NotifyShutdownWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/NotifyShutdownWork.java
@@ -21,10 +21,7 @@ package org.apache.hyracks.control.cc.work;
 
 import java.util.logging.Logger;
 
-import org.apache.hyracks.api.deployment.DeploymentId;
 import org.apache.hyracks.control.cc.ClusterControllerService;
-import org.apache.hyracks.control.common.deployment.DeploymentRun;
-import org.apache.hyracks.control.common.deployment.DeploymentStatus;
 import org.apache.hyracks.control.common.shutdown.ShutdownRun;
 import org.apache.hyracks.control.common.work.SynchronizableWork;
 
@@ -44,7 +41,7 @@ public class NotifyShutdownWork extends SynchronizableWork {
     public void doRun() {
         /** triggered remotely by a NC to notify that the NC is shutting down */
         ShutdownRun sRun = ccs.getShutdownRun();
-        LOGGER.info("Recieved shutdown acknowledgement from NC ID:" + nodeId);
+        LOGGER.info("Received shutdown acknowledgement from NC ID:" + nodeId);
         sRun.notifyShutdown(nodeId);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3954de1a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/base/INodeController.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/base/INodeController.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/base/INodeController.java
index 7fe2f58..75c3127 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/base/INodeController.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/base/INodeController.java
@@ -51,7 +51,7 @@ public interface INodeController {
 
     public void dumpState(String stateDumpId) throws Exception;
 
-    public void shutDown() throws Exception;
+    public void shutdown() throws Exception;
 
     public void sendApplicationMessageToNC(byte[] data, DeploymentId deploymentId, String
nodeId) throws Exception;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/3954de1a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/ipc/NodeControllerRemoteProxy.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/ipc/NodeControllerRemoteProxy.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/ipc/NodeControllerRemoteProxy.java
index f7f73d7..841c889 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/ipc/NodeControllerRemoteProxy.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/ipc/NodeControllerRemoteProxy.java
@@ -90,7 +90,7 @@ public class NodeControllerRemoteProxy implements INodeController {
     }
 
     @Override
-    public void shutDown() throws Exception {
+    public void shutdown() throws Exception {
         CCNCFunctions.ShutdownRequestFunction sdrf = new CCNCFunctions.ShutdownRequestFunction();
         ipcHandle.send(-1, sdrf, null);
     }


Mime
View raw message