Community
Participate
Working Groups
Build R2.1 Until some Job is queued again, the JobManager should wait instead of actively sleeping.
The Thread methods named resume(), suspend() & stop() have all been deprecated since 1.3 (because of the potential for deadlock). The only supported protocol I can find for background threads is to sleep.
What about Object.wait() and Object.notify(), see ReadWriteMonitor.
Ok, I've made the changes & they work BUT our tests are failing in random spots because of timing issues. Since the IndexManager was sleeping upto 500ms before starting a new job, it was possible for tests to create & delete resources without conflicts. Now the IndexManager opens any new resource right after the job is posted... this prevents the test from deleting the resource. I've added retry loops in the tests where possible, but some calls are to the JavaModel move command, where its impossible to know if retry will work.
In the released changes we are no longer actively sleeping, but instead wait for a new job to be posted... but instead of processing it immediately, we give the main thread a bit of time to finish before starting to process the job.
Verified.