hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1337254 - in /hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project: bin/mr-jobhistory-daemon.sh hadoop-yarn/bin/yarn-daemon.sh
Date Fri, 11 May 2012 16:18:26 GMT
Author: atm
Date: Fri May 11 16:18:26 2012
New Revision: 1337254

URL: http://svn.apache.org/viewvc?rev=1337254&view=rev
Log:
HADOOP-8353. hadoop-daemon.sh and yarn-daemon.sh can be misleading on stop. Contributed by
Roman Shaposhnik.

Modified:
    hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
    hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh

Modified: hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh?rev=1337254&r1=1337253&r2=1337254&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
(original)
+++ hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/bin/mr-jobhistory-daemon.sh
Fri May 11 16:18:26 2012
@@ -94,6 +94,7 @@ export HADOOP_ROOT_LOGGER=${HADOOP_ROOT_
 export HADOOP_JHS_LOGGER=${HADOOP_JHS_LOGGER:-INFO,JSA}
 log=$YARN_LOG_DIR/yarn-$YARN_IDENT_STRING-$command-$HOSTNAME.out
 pid=$YARN_PID_DIR/yarn-$YARN_IDENT_STRING-$command.pid
+YARN_STOP_TIMEOUT=${YARN_STOP_TIMEOUT:-5}
 
 # Set default scheduling priority
 if [ "$YARN_NICENESS" = "" ]; then
@@ -129,9 +130,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 $YARN_STOP_TIMEOUT
+        if kill -0 $TARGET_PID > /dev/null 2>&1; then
+          echo "$command did not stop gracefully after $YARN_STOP_TIMEOUT seconds: killing
with kill -9"
+          kill -9 $TARGET_PID
+        fi
       else
         echo no $command to stop
       fi

Modified: hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh?rev=1337254&r1=1337253&r2=1337254&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh
(original)
+++ hadoop/common/branches/branch-2.0.0-alpha/hadoop-mapreduce-project/hadoop-yarn/bin/yarn-daemon.sh
Fri May 11 16:18:26 2012
@@ -93,6 +93,7 @@ export YARN_LOGFILE=yarn-$YARN_IDENT_STR
 export YARN_ROOT_LOGGER=${YARN_ROOT_LOGGER:-INFO,RFA}
 log=$YARN_LOG_DIR/yarn-$YARN_IDENT_STRING-$command-$HOSTNAME.out
 pid=$YARN_PID_DIR/yarn-$YARN_IDENT_STRING-$command.pid
+YARN_STOP_TIMEOUT=${YARN_STOP_TIMEOUT:-5}
 
 # Set default scheduling priority
 if [ "$YARN_NICENESS" = "" ]; then
@@ -128,9 +129,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 $YARN_STOP_TIMEOUT
+        if kill -0 $TARGET_PID > /dev/null 2>&1; then
+          echo "$command did not stop gracefully after $YARN_STOP_TIMEOUT seconds: killing
with kill -9"
+          kill -9 $TARGET_PID
+        fi
       else
         echo no $command to stop
       fi



Mime
View raw message