Community
Participate
Working Groups
I am scheduling a job with a delay (could also be more than one!), which are enqueued in the Job Manager's sleeping queue. Precondition: Only 1 WorkerThread available at the moment. This is the case on startup or after over a minute inactivity since the last job (WorkerPool.MIN_THREADS, BEST_BEFORE) // SimpleJob does only forward the run command to a procmodel object's run // which does some calculations IProcModel mod=new FooProcModel(); Job myjob=new SimpleJob("FOOJOB",mod); myjob.setPriority(Job.SHORT); myjob.schedule(10000); After that - and before the delay for the FooJob is over - I schedule another job, this time without delay. IProcModel mod=new BarProcModel("BAR"); Job myjob2=new SimpleJob("BARJob",mod); myjob2.setPriority(SimpleJob.JOB_PRIO); // Prio is set to LONG myjob2.schedule(); The worker pool assigns the only free worker to the BarJob. But the BarProcModel contains some very long running calculation (e.g. 1-2 mins). Now the only available worker is occupied and no one now regularly peeks into the sleeping queue to see if there is any sleeping job to run. When BarJob has finished, the FooJob(s) immediately is(are) scheduled. If BarJob is badly behaved and gets frozen the FooJob never starts unless one schedules another job. PS: The error is also reproducable even if there are more than one worker threads in the pool: schedule a job Foo with a delay and then make sure to occupy all existing workers with long-running jobs. Foo will not earlier run as soon as the first long running job finishes.
*** This bug has been marked as a duplicate of 82146 ***