[torqueusers] epilogue script runs twice

Garrick Staples garrick at usc.edu
Mon Jan 11 15:29:55 MST 2010

On Mon, Jan 11, 2010 at 04:58:19PM -0500, Kevin Van Workum alleged:
> > If your script knew that epilogue was run before, what would it change?
> >
> There are cases when the epilogue script should do some task(s) only once.
> If it knew that a particular job had already been (or is currently being)
> processed by a previous instantiation, it could just skip the do-only-once
> tasks.
> > You still wouldn't know if it completed; if it completed successfully. Your
> > script wouldn't know if *it* had been run before; if it completed. What if
> > your
> > script had been terminated halfway through it's critical stage?
> >
> > Everything in epilogue just needs to be written to be indempotent.
> >
> Sure, but it would be much easier in some cases if you knew a priori that
> epilogue had already been called to process a job. E.g. 'echo "your job
> completed on $(date)" >> some.log' would be difficult to make idempotent.

My point is that you still wouldn't know if the particular actions completed or 

Say, for example, that epilogue ran a script that did some sort of database
operation. Imagine that the initial database connection hung and epilogue timed
out. Would you want to skip that database operation on subsequent epilogue

It doesn't matter how many times epilogue runs, you still need to check each of
the tasks you wish to perform and make sure they have been done.

  grep -q "$JOBID completed" some.log || echo "$JOBID completed on $(date)" >> some.log

(personally, I log "epilogue started at $date" at the beginning of the script,
and "epilogue completed at $date" at the end)

Garrick Staples, GNU/Linux HPCC SysAdmin
University of Southern California

Life is Good!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20100111/60db83dc/attachment.bin 

More information about the torqueusers mailing list