Job succeeded, but exit status was non-zero

If you have a job with this configuration

script = return 0
exit-script = return 1

Cylc will report the job as succeeded (because script passed), but, the actual exit status will be non-zero. This is a bit confusing when examining logs. I am guessing there is a reason for the approach adopted here (is this a change from Cylc7?), perhaps a speed reason (send status whilst finishing off so subsequent tasks can start), but it can mask issues with the exit/post script sections as people may not notice.

Well, the documentation says " Custom script run at the very end of successful job execution, just before the job script exits.".

So I think the point is, the exit-script, which is supposed to be something simple and fast, should have no bearing on the result - the job already succeeded.

Where do you actually detect the final return status? I think it’s only visible in the job.xtrace log in debug mode.

Fair point on masking bugs in the exit-script itself, but that shouldn’t be the case for post-script - errors in that will cause the task to fail.

OK, I’ve only looked at exit script.

PBS prints out to our job.out,and it is also the exit status in qstat output. Ignoring masking exit script errors, perhaps the return from the exit script should always be 0 to be consistent with a success?

Maybe it should be, but I think it could be argued either way.

I guess currently that status code does give an indication that the exit-script has an error, and without that it would be fully masked.