Details
-
Fix
-
Status: Dismissed (View Workflow)
-
Minor
-
Resolution: Won't Fix
-
1.10.8, 1.11.5
-
None
Description
Current Situation
- The exit_code set by spooler_task.exit_code are not respected.
- If spooler_task.exit_code=9 and function retun false, the job chain flow is not changed and order will be moved to the error
Desired Behavior
- When changing the spooler_task.exit_code in the spooler_process() and return the spooler_process() with true, the exit_code set from _spooler_task.exit_code should be respected by the job chain to decide the flow of job chain with an given on_return_codes configuration.
Maintenance Note
This will not be resolved for api jobs. The reason is that a task for an api job may handle more then one order. This depends on the idle_timeout value specified in the job configuration. The exit code of the task is available when task ends and not when the spooler_process has a return code. To change this the return of the spooler must be changed from boolean to integer. This will produce a lot of incompatibilty. Therefore the behaviour will not be changed. Instead of this a workaround will be described.
Workaround
- Instead of setting the exit code spooler_task.exit_code=3 set an order parameter spooler_task.order().params().set_var("task_exit_code","3"
- Add a shell job as a successor of the api job (The name could be exit_code_handler
- The shell job exits with the order parameter task_exit_code exit $SCHEDULER_PARAM_TASK_EXIT_CODE
- The shell job implements the on_return configuration