Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2229

Perform graceful terminate with retries before doing forceful kill for usersync and tagsync

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 2.0.0
    • tagsync, usersync
    • None

    Description

      In ranger usersync and tagsync scripts, stop of the process is done forcefully using kill -9.
      Suggestion is to do a graceful shutdown with retries and do a force kill only if graceful shutdown is not successful.

      Stop section from ranger-tagsync-services.sh and ranger-tusersync-services.sh

      lif [ "${action}" == "STOP" ]; then
       WAIT_TIME_FOR_SHUTDOWN=2
       NR_ITER_FOR_SHUTDOWN_CHECK=15
       if [ -f "$pidf" ] ; then
       pid=`cat $pidf` > /dev/null 2>&1
       echo "Found Apache Ranger TagSync Service with pid $pid, Stopping..."
       kill -9 $pid > /dev/null 2>&1
       sleep 1 #Give kill -9 sometime to "kill"
       if ps -p $pid > /dev/null; then
       echo "Wow, even kill -9 failed, giving up! Sorry.."
       else
       rm -f $pidf
       echo "Apache Ranger Tagsync Service pid = ${pid} has been stopped."
       fi
       else
       echo "Ranger Tagsync Service not running"
       fi
       exit;
      

      Attachments

        1. RANGER-2229-01.patch
          2 kB
          Bhavik Patel
        2. RANGER-2229.patch
          4 kB
          Bhavik Patel

        Issue Links

          Activity

            People

              bpatel Bhavik Patel
              suja suja s
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: