sohami commented on a change in pull request #1536: DRILL-6039: Fixed 
drillbit.sh script to do graceful shutdown
URL: https://github.com/apache/drill/pull/1536#discussion_r234069987
 
 

 ##########
 File path: distribution/src/resources/drillbit.sh
 ##########
 @@ -94,11 +94,24 @@ waitForProcessEnd()
   commandName=$2
   kill_drillbit=$3
   processedAt=`date +%s`
+  triggered_shutdown=false
+  FILE=$DRILL_PID_DIR/.graceful
   origcnt=${DRILL_STOP_TIMEOUT:-120}
   while kill -0 $pidKilled > /dev/null 2>&1;
    do
      echo -n "."
      sleep 1;
+     #Incase of graceful shutdown, create .graceful file and wait till it is 
deleted to trigger kill command.
+     if [ "$kill_drillbit" = false ]; then
+       if [ "$triggered_shutdown" = false ]; then
+         touch $DRILL_PID_DIR/.graceful
+         triggered_shutdown=true
+       else
+         if [ ! -f "$FILE" ]; then
+           kill $pidKilled > /dev/null 2>&1;
 
 Review comment:
   this shouldn't be required since after `close` Drillbit process should exit. 
If not then we should find out the reason behind it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to