You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nk...@apache.org on 2013/02/14 12:07:05 UTC

svn commit: r1446116 - /hbase/trunk/bin/hbase-daemon.sh

Author: nkeywal
Date: Thu Feb 14 11:07:05 2013
New Revision: 1446116

URL: http://svn.apache.org/r1446116
Log:
HBASE-7838 HBase regionserver never stoping when running  (Damien Hardy)

Modified:
    hbase/trunk/bin/hbase-daemon.sh

Modified: hbase/trunk/bin/hbase-daemon.sh
URL: http://svn.apache.org/viewvc/hbase/trunk/bin/hbase-daemon.sh?rev=1446116&r1=1446115&r2=1446116&view=diff
==============================================================================
--- hbase/trunk/bin/hbase-daemon.sh (original)
+++ hbase/trunk/bin/hbase-daemon.sh Thu Feb 14 11:07:05 2013
@@ -235,6 +235,7 @@ case $startStop in
     rm -f "$HBASE_START_FILE"
     if [ -f $pid ]; then
       pidToKill=`cat $pid`
+      processedAt=`date +%s`
       # kill -0 == see if the PID exists
       if kill -0 $pidToKill > /dev/null 2>&1; then
         echo -n stopping $command
@@ -244,7 +245,16 @@ case $startStop in
          do
            echo -n "."
            sleep 1;
+           # if process persists more than $HBASE_STOP_TIMEOUT (default 1200 sec) no mercy
+           if [ $(( `date +%s` - $processedAt )) -gt ${HBASE_STOP_TIMEOUT:-1200} ]; then
+             break;
+           fi
          done
+        # process still there : kill kill
+        if kill -0 $pidToKill > /dev/null 2>&1; then
+          echo -n force stopping $command
+          kill -9 $pidToKill > /dev/null 2>&1
+        fi
         rm $pid
         echo
       else