You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2017/08/24 13:58:15 UTC

asterixdb git commit: [ASTERIXDB-2032] Restore use of REST shutdown API

Repository: asterixdb
Updated Branches:
  refs/heads/master 8e36d657b -> d828754b3


[ASTERIXDB-2032] Restore use of REST shutdown API

This reverts commit 122a73693e4a6a2484936ed86967e843d4dfa4e1.

Change-Id: Ie73cc5dab3b9ad06120ca634f5aee9dfeef6d07b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1958
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <im...@apache.org>


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

Branch: refs/heads/master
Commit: d828754b334534423e87dc13edf01fd2446b2afc
Parents: 8e36d65
Author: Michael Blow <mb...@apache.org>
Authored: Mon Aug 21 18:09:16 2017 -0700
Committer: Michael Blow <mb...@apache.org>
Committed: Thu Aug 24 06:57:30 2017 -0700

----------------------------------------------------------------------
 .../main/opt/local/bin/stop-sample-cluster.sh   | 23 ++++++--------------
 1 file changed, 7 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d828754b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
index f33f403..dbce377 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
@@ -25,16 +25,6 @@ function usage() {
   echo "  -f[orce]  : Forcibly terminates any running ${PRODUCT} processes (after shutting down cluster, if running)"
 }
 
-function kill_procs() {
-  cat /tmp/$$_pids | while read line; do
-    if [ $minus_nine ]; then
-       echo $line | awk '{ print $2 }' | xargs -n1 kill -9
-    else
-       echo $line | awk '{ print $2 }' | xargs -n1 kill
-    fi
-  done
-}
-
 while [ -n "$1" ]; do
   case $1 in
     -f|-force) force=1;;
@@ -68,10 +58,7 @@ CLUSTERDIR=$(cd "$DIRNAME/.."; echo $PWD)
 INSTALLDIR=$(cd "$CLUSTERDIR/../.."; echo $PWD)
 "$INSTALLDIR/bin/${HELPER_COMMAND}" get_cluster_state -quiet
 if [ $? -ne 1 ]; then
-  if ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)' > /tmp/$$_pids; then
-    minus_nine=0;
-    kill_procs;
-  fi
+  "$INSTALLDIR/bin/${HELPER_COMMAND}" shutdown_cluster_all
   first=1
   tries=0
   echo -n "INFO: Waiting up to 60s for cluster to shutdown"
@@ -92,8 +79,12 @@ fi
 if ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)' > /tmp/$$_pids; then
   echo -n "WARNING: ${PRODUCT} processes remain after cluster shutdown; "
   if [ $force ]; then
-    minus_nine=1;
-    kill_procs;
+    echo "-f[orce] specified, forcibly terminating ${PRODUCT} processes:"
+    cat /tmp/$$_pids | while read line; do
+      echo -n "   - $line..."
+      echo $line | awk '{ print $2 }' | xargs -n1 kill -9
+      echo "killed"
+    done
   else
     echo "re-run with -f|-force to forcibly terminate all ${PRODUCT} processes:"
     cat /tmp/pids |  sed 's/^ *[0-9]* \([0-9]*\).*org\.apache\.hyracks\.control\.[cn]c[^ ]*\.\([^ ]*\) .*/\1 - \2/'