Community
Participate
Working Groups
The setup is the following: We have two Jobs currently executing. They both finish and the Worker (run()) calls "endJob(currentJob, result)" on the WorkerPool. The first thing the WorkerPool does is to decrement the busyThreads counter (decrementBusyThreads()), which is then "0". Afterwards the JobManager is informed (manager.endJob(job, result, true)). The JobManager sends an event to the listeners (jobListeners.done((Job) job, result, reschedule)). Keep in mind, all this is happening on the two Worker threads, not on the InternalWorker thread. If now the listeners do not finish for some time (waiting on a lock, user interaction,...), both threads are occupied. Now we try to schedule a new Job. It will be added to the queue and the WorkerPool gets informed by the JobManager by calling "jobQueued()". "jobQueued" first checks if there are sleeping threads (no, all are busy) and it then checks if all Worker are occoupied (busyThreadsCounter >= numThreads), which fails too, because the busyThreadsCounter is "0". No new Worker is created and the Job is waiting in the queue. The Job is not executed till one of the listeners finishes. Most of the time this is not a problem, but an easy fix for the other cases would be to postpone the decrement of the busyThreads counter until the listeners have finished.
Thank you for the detailed analysis!
Created attachment 180186 [details] Patch v01
Fix released.
*** Bug 375166 has been marked as a duplicate of this bug. ***