| Summary: | JobManager does not wake up a scheduled job | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | John Arthorne <john.arthorne> | ||||
| Component: | Runtime | Assignee: | John Arthorne <john.arthorne> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | ivan.motsch, john.arthorne, loskutov, mober.at+eclipse, pwebster, remy.suen, sptaszkiewicz, stephan.leichtvogt, wbprio, yevshif | ||||
| Version: | 3.7.1 | Flags: | dj.houghton:
review+
|
||||
| Target Milestone: | 3.7.2 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 366170 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
John Arthorne
Backporting fix to 3.7.2 stream. Created attachment 209474 [details]
Patch
The old code was: if (manager.sleepHint() <= 0) jobQueued(); This means: if there is a job ready to run right now, ensure there is a worker thread available The new code is: if (manager.sleepHint() < InternalJob.T_INFINITE) jobQueued(); This means: if there is any job ready to run now or at any time in the future, ensure there is a worker thread available Hi John,
we are observing strange JUnit test failures which I think *could* be related to the job manager and this bug in particular. Unfortunately it is hard to provide stripped down test case.
What we do is to test internal message dispatching job. Test generates events in a loop and test is checking each time if the messages were dispatched properly. Dispatching should be done in a job. This works in 99.9% of the tests, but sometimes *randomly* fail.
I've did VM snapshots on fail and found that the job which was re-scheduled during the test was always in the SLEEPING state.
We have this scenario:
Main (Eclipse test framework):
workbench.getProgressService().busyCursorWhile ()
schedule(0) job A and join on it
A (Test job):
re-schedules (with timeout of 10ms) the job B in the loop
do Thread.sleep(few seconds) each time
and fail if job B is NOT done after each sleep
B:
dispatch events until internal message queue is not empty
Observation: sometimes job B is never executed, staying in SLEEPING state.
We see this with both 3.5.1, 3.7.1 and 3.7.2 Eclipse versions on RHEL 5.3 Linux/Sun 1.6 VM 64 bit. As the scenario we have is similar (join + sleep + schedule(time)), I've expected seeing the problem resolved in 3.7.2, but this is not the case.
Could it be that there is still some special cases left where Job manager does not activate (run) scheduled jobs?
|