hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1372692 - in /hadoop/common/branches/branch-1.1: CHANGES.txt bin/hadoop-daemon.sh
Date Tue, 14 Aug 2012 00:58:25 GMT
Author: stevel
Date: Tue Aug 14 00:58:24 2012
New Revision: 1372692

URL: http://svn.apache.org/viewvc?rev=1372692&view=rev
Log:
HADOOP-8656 Backport forced daemon shutdown of HADOOP-8353 into branch-1

Modified:
    hadoop/common/branches/branch-1.1/CHANGES.txt
    hadoop/common/branches/branch-1.1/bin/hadoop-daemon.sh

Modified: hadoop/common/branches/branch-1.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/CHANGES.txt?rev=1372692&r1=1372691&r2=1372692&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.1/CHANGES.txt Tue Aug 14 00:58:24 2012
@@ -12,6 +12,9 @@ Release 1.1.1 - Unreleased
 
   IMPROVEMENTS
 
+    HADOOP-8656 Backport forced daemon shutdown of HADOOP-8353 into branch-1
+    (Roman Shaposhnik via stevel)
+
   BUG FIXES
 
 Release 1.1.0 - 2012.07.09

Modified: hadoop/common/branches/branch-1.1/bin/hadoop-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.1/bin/hadoop-daemon.sh?rev=1372692&r1=1372691&r2=1372692&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.1/bin/hadoop-daemon.sh (original)
+++ hadoop/common/branches/branch-1.1/bin/hadoop-daemon.sh Tue Aug 14 00:58:24 2012
@@ -105,6 +105,7 @@ export HADOOP_LOGFILE=hadoop-$HADOOP_IDE
 export HADOOP_ROOT_LOGGER="INFO,DRFA"
 log=$HADOOP_LOG_DIR/hadoop-$HADOOP_IDENT_STRING-$command-$HOSTNAME.out
 pid=$HADOOP_PID_DIR/hadoop-$HADOOP_IDENT_STRING-$command.pid
+HADOOP_STOP_TIMEOUT=${HADOOP_STOP_TIMEOUT:-5}
 
 # Set default scheduling priority
 if [ "$HADOOP_NICENESS" = "" ]; then
@@ -140,9 +141,15 @@ case $startStop in
   (stop)
 
     if [ -f $pid ]; then
-      if kill -0 `cat $pid` > /dev/null 2>&1; then
+      TARGET_PID=`cat $pid`
+      if kill -0 $TARGET_PID > /dev/null 2>&1; then
         echo stopping $command
-        kill `cat $pid`
+        kill $TARGET_PID
+        sleep $HADOOP_STOP_TIMEOUT
+        if kill -0 $TARGET_PID > /dev/null 2>&1; then
+          echo "$command did not stop gracefully after $HADOOP_STOP_TIMEOUT seconds: killing
with kill -9"
+          kill -9 $TARGET_PID
+        fi
       else
         echo no $command to stop
       fi



Mime
View raw message