Details
-
Fix
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
1.13
-
None
Description
Current Situation
- The JobScheduler crashes when any API job is used with a Monitor script to set the state of an Order to an end node of the job chain by use of the spooler_task.order.state property.
- The error message reported with the scheduler.log file is as follows:
.16 23:33:31.772 scheduler 83750 16632.19B0 9953.563MB TerminateProcess(0000000000000CA4,99) .16 23:33:31.773 scheduler 0 16632.19B0 9953.563MB [xc.insert 1, "java.lang.IllegalStateException: Not in C++ thread. This is 'Thread[C++ Heart_beat_watchdog_thread,5,main]', expected is 'Thread[C++,5,main]'"] .16 23:33:31.773 scheduler 0 16632.19B0 9953.563MB [xc.insert 2, "CallVoidMethodA"] .16 23:33:31.773 scheduler 0 16632.19B0 9953.563MB {scheduler} start_process(""C:\Program Files\sos-berlin.com\jobscheduler\apmacwin_4444\bin\scheduler.exe" -service=sos_scheduler_apmacwin_4444 -exclusive -id=apmacwin_4444 -sos.ini=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/config/sos.ini -config=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/config/scheduler.xml -ini=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/config/factory.ini -env="SCHEDULER_HOME=C:/Program Files/sos-berlin.com/jobscheduler/apmacwin_4444" -env=SCHEDULER_DATA=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444 -param=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444 -cd=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444 -include-path=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444 -pid-file=C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/scheduler.pid -renew-service "-renew-spooler=C:\Program Files\sos-berlin.com\jobscheduler\apmacwin_4444\bin\scheduler.exe"") .16 23:33:31.776 scheduler 0 16632.19B0 9953.563MB close(4) C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/scheduler.pid .16 23:33:31.780 scheduler 15 16632.19B0 9953.563MB unlink("C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/scheduler.pid") .16 23:33:31.780 scheduler 0 16632.19B0 9953.563MB {scheduler} TerminateProcess( GetCurrentProcess() );
- The monitor script to reproduce the problem is as follows:
function spooler_process_before() { spooler_task.order.state = 'success'; return false; }
- Observations
- The problem occurs independently from the number of job nodes in a job chain.
- The following jobs are reported to work and not to reproduce the problem:
- Shell jobs using or not using the above Monitor script:
<job order="yes" stop_on_error="false"> <script language="shell"><![CDATA[echo "hello world" ]]></script> <monitor name="process0" ordering="0"> <script language="java:javascript"><![CDATA[function spooler_process_before() { spooler_task.order.state = 'success'; return false; } ]]></script> </monitor> <run_time/> </job>
- Java jobs not using the above Monitor script:
<job order="yes" stop_on_error="false"> <params> <param name="to" value="spam@sos-berlin.com"/> <param name="subject" value="JITL-606"/> </params> <script language="java" java_class="sos.scheduler.managed.JobSchedulerManagedMailJob"/> <run_time/> </job>
- JavaScript jobs not using the above Monitor script:
<job order="yes" stop_on_error="false"> <script language="java:javascript"><![CDATA[function spooler_process_before() { spooler_task.order.state = 'success'; return false; } function spooler_process() { return true; } ]]></script> <run_time/> </job>
- Shell jobs using or not using the above Monitor script:
- The following jobs using the above Monitor script reproduce the problem:
- Java jobs using the above Monitor script:
<job order="yes" stop_on_error="false"> <params> <param name="to" value="spam@sos-berlin.com"/> <param name="subject" value="JITL-606"/> </params> <script language="java" java_class="sos.scheduler.managed.JobSchedulerManagedMailJob"/> <run_time/> </job>
- JavaScript jobs using the above Monitor script:
<job order="yes" stop_on_error="false"> <script language="java:javascript"><![CDATA[function spooler_process() { return true; } ]]></script> <monitor name="process0" ordering="0"> <script language="java:javascript"><![CDATA[function spooler_process_before() { spooler_task.order.state = 'success'; return false; } ]]></script> </monitor> <run_time/> </job>
- Java jobs using the above Monitor script:
How to reproduce
- Unzip the attached Job Configuration JITL-606.zip
. The attached configuration uses JobSchedulerManagedMailJob to reproduce the issue.
- Login to the JOC Cockpit.
- Navigate to the Job Chains tab and start the order test_wizard.
- The JobScheduler crashes after some time.
Desired Behavior
- The JobScheduler should not crash even if the order state is set to an end node using a Monitor script for an API job in a job chain.