Details
-
Fix
-
Status: Dismissed (View Workflow)
-
Minor
-
Resolution: Bogus
-
None
-
None
-
None
Description
Current Situation
- We assume a shell job triggered by an order terminates with exit code != 0.
- We modify the exit code to 0 via the API in the postprocessing method spooler_task_after().
- Then the order nevertheless proceeds to the error node of the job chain:
Example
<job order="yes" stop_on_error="no"> <script language="shell"><![CDATA[ exit 5 ]]></script> <monitor name="process0" ordering="0"> <script language="javascript"><![CDATA[ function spooler_task_after() { spooler_task.exit_code = 0; } ]]></script> </monitor> </job>
Resolution
- The method spooler_task.exit_code() sets the exit code for the respective order. However, this method does not affect the result of the order.
- To affect the behavior of an order proceeding with the next_state or error_state in a job chain implement the spooler_process_after() method like this:
function spooler_process_after( resultOK ) { // resultOK == true return false; }
Attachments
Issue Links
- is related to
-
JS-1757 Exit code set by spooler_task.exit_code should be evaluated by job chain on_return_code
- Dismissed