MantisBT - JANA
View Issue Details
0000465JANABugpublic2015-10-20 15:522015-11-29 15:18
davidl 
davidl 
normalminorN/A
resolvedfixed 
0000465: JANA program does not exit with non-zero code
This was brought up by Paul M. regarding some CLAS6 jobs he was running. A few of his jobs reached a thread time-out causing JANA to quit early. Without the relaunch flag set, this will print a message and set the Quit() flag. JANA then exits cleanly (i.e. returns from Run() ) and the program doesn't know to return a non-zero exit value. The farm manager then indicates that the job was a SUCCESS, even though it really wasn't.

We don't necessarily want a thread time-out to cause an immediate exit. At the same time, though, we do want the program to exit with a non-zero code so that the farm manager can detect this. Options are:

1. If in BATCH mode, do exit immediately

2. set an exit code in JApplication that should be returned from Run() and may also be accessible using the JApplication pointer. This will allow the actual program (e.g. hb_root) to check for this and return an appropriate exit code.


No tags attached.
Issue History
2015-10-20 15:52davidlNew Issue
2015-10-27 10:15kmoriyaNote Added: 0000650
2015-11-24 16:47davidlNote Added: 0000651
2015-11-29 15:18davidlNote Added: 0000653
2015-11-29 15:18davidlStatusnew => resolved
2015-11-29 15:18davidlResolutionopen => fixed
2015-11-29 15:18davidlAssigned To => davidl

Notes
(0000650)
kmoriya   
2015-10-27 10:15   
For farm jobs, Kei did tests with
exit $exit_signal
and found that both SWIF and Auger are able to pick up this exit code.
SWIF will also mark the job with problem tag "SWIF-USER-NON-ZERO".

Exit codes higher than 128 and in the range (30,40) should be avoided
since Chris uses these within SWIF.
(0000651)
davidl   
2015-11-24 16:47   
Kei also noted that when a file doesn't exist and an error message is printed, the exit code is still "0". This should be set to something non-zero.
(0000653)
davidl   
2015-11-29 15:18   
Fixed in revision 2371 and will appear in JANA 0.7.4.

JANA utilities and examples updated to use it and provide example on how to.