Ticket #254 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

/usr/local/topaz/bin/tomcat java_stop wait time is too short

Reported by: russ Assigned to: ebrown
Priority: unassigned Milestone:
Component: topaz Version: 0.5-rc7
Keywords: startup service mulgara tomcat Cc:
Blocking: Blocked By:

Description (Last modified by ronald)

when stopping a service with /usr/local/bin/tomcat, java_stop waits 15 seconds for the service to shut down, and then gives up.

mulgara often takes longer than 15 seconds to shut down.

if, in the course of a backup, mulgara is restarted before it has completely shut down, hilarity ensues.

i'm going to suggest that we wait 60 seconds, and then kill the process if it's still not down at that point.

please comment if you think this is a bad idea. we need *some* reliable way to stop and start the services in order to run backups. please commit to rc7 if you think it's okay.

here's my updated java_stop routine:

java_stop() {
  $JAVA_HOME/bin/java $TOMCAT_OPTS $CATALINA_OPTS stop >>$STDLOG 2>&1
  # Give it a few seconds to stop (to delete PID file)
  # if it's not dead yet, kill it over and over again
  PID=`cat ${PIDFILE} 2>/dev/null`
  i=1
  while [ -n "$PID" ] ; do
    PID=`ps -p $PID -o pid | tail -n +2`
    sleep 1
    i=$((i+1))
    if [ $i -gt 60 ]; then
        echo "murder death kill"
        kill $PID
    fi
  done
  [ -z "$PID" ] && rm -f $PIDFILE
}

Dependency Graph

Change History

01/03/07 16:38:33 changed by ronald

  • description changed.

01/05/07 10:26:26 changed by amit

  • owner changed from somebody to ebrown.

Assigning to Eric. Do we have any other way other than a brutal kill?

01/08/07 15:28:17 changed by ebrown

Kosher?

:)

The thing should stop with a non-zero status if it fails to stop the process. I don't mind increasing the default timeout to 60-seconds.

Instead of killing by default though, I'd suggest two new flags:

  • -f: Send a kill -sTERM at the end. (If that doesn't do it, still return non-zero status.)
  • -F: Send a kill -sTERM, wait a bit and send a -sKILL

Unless anybody disagrees, I'll go ahead.

Eric

01/12/07 16:52:27 changed by ebrown

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [2255]

02/22/07 15:16:14 changed by ebrown

See #243. 60-seconds is still probably wise (for mulgara anyway).

10/29/07 21:13:05 changed by

  • milestone deleted.

Milestone 0.5rc8 deleted