jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alistair Forbes" <forbes...@googlemail.com>
Subject Re: Indexed Disk Cache (Key/Value Corruption)
Date Wed, 02 Aug 2006 21:47:38 GMT
Probably overcomplicated for most folks... but basically it uses the
"-shutdown" option, and I now wait 80 secs before killing any process. Seems
to help, but it's hard to reproduce the error, so I will wait any see what
happens.

        java -cp ${CLASSPATH} ${JCS_FACTORY} -shutdown /${JCS_CONFIG_FILE}

         # kill java
         shutdown $PROCESS_NAME
         # kill the shell too
         kill $(cat $PIDFILE)


function shutdown {
   TIMEOUT=80          # 80s default timeout
   [[ -n "$2" ]] && TIMEOUT=$2

   DURATION=0
   START=$(date '+%s')
   PROCS=$(ps -efwww | grep $1 | grep -v grep | wc -l)

   while [[ $DURATION -lt $TIMEOUT ]] && [[ $PROCS -ne 0 ]]; do
      CURR=$(date '+%s')
      ((DURATION=CURR-START))

      PROCS=$(ps -efwww | grep $1 | grep -v grep | wc -l)
      APROCS=$(ps -efwww | grep $1 | grep -v grep | gawk '{ print $NF }' |
sort -u)
      echo $1: waiting for $DURATION s, processes left: $PROCS \($APROCS\)
      sleep 1
   done;

   if [[ $DURATION -ge $TIMEOUT ]] && [[ $PROCS -ne 0 ]]; then
      echo $1: $PROCS process\(es\) left, kill-9ing..
      [[ -f "$PIDFILE" ]] && kill -9 $(cat $PIDFILE)
      ps -efwww | grep $1 | grep -v grep | gawk '{ print $2 }' | xargs -r
kill -9
   fi
}

On 8/2/06, Ted Rice <trice@netsuite.com> wrote:
>
> Thanks for the response.
>
> Any information on how you were shutting down the remote server?
>
> i.e. Using the RemoteServerStub and calling shutdown
>
> Currently we are sending the Process ID a SIGHUP to stop it and are in the
> process of implementing a stop via the RemoteServerStub prior to that.
>
> Will that shutdown process give us the best chance of not corrupting the
> disk
> cache? How long do you usually wait before killing?
>
>
> Alistair Forbes wrote:
> > I have had this a couple of times, and have seen one other person
> reporting
> > the same thing. Pretty damaging results!
> >
> > I thought it may have had something to do with the remote cache not
> flushing
> > to disk before an exit. But I am not 100% sure. I now wait for longer
> before
> > killing any processes. If I get a bit more time I will try with 0 memory
> > (disk only cache) and see if the same thing happens.
> >
> > Regards
> > Al
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message