Community
Participate
Working Groups
When a job sleeps due to a reschedule after it is done no event is sent to IJobChangeListeners to inform of the change. Likewise when it wakes up. As a result the ProgressManager is not removing sleeping jobs or updating them when they wake up again.
Created attachment 90064 [details] Example This example adds a command which shows all of the events sent for a test job. To replicate this issue load org.eclipse.ui.examples.jobs and start a job that reschedules itself 3 seconds later. You will not get the sleep or awake events.
Created attachment 92830 [details] Patch Here is a patch to solve the sleep case. Note that fix for Bug 209744 does not require this in the end - I can solve it with the current behaviour
Sorry it is Bug 167294 that is not affected
Please note that there appears to be a deadlock in my patch presumably because I am calling the sleep event inside of the job lock.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
"awake" notification is only emitted when Job.wakeUp() method is called and job is in a certain state (usually sleeping). "sleeping" notification is only called when Job.sleep() method is called and job is in a certain state (sleeping or waiting). Both are very special cases and rarely used (for example, sleep() is very similar to cancel() in behaviour, and cancel() should be used in most cases, wakeUp() is similar to schedule(), and schedule() should be used in most cases). It would be nice to have that clarified in Javadoc of org.eclipse.core.runtime.jobs.IJobChangeListener Even better would be to deprecate both Job.sleep() and Job.wakeUp(), or document when they should be used in Javadoc.