-
Notifications
You must be signed in to change notification settings - Fork 146
Fix Job.schedule() not rescheduling after cancel() #2209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix Job.schedule() not rescheduling after cancel() #2209
Conversation
The aboutToRunCanceled flag was not being cleared when reschedule=true, causing jobs to be canceled instead of scheduled. This fix moves the flag clearing to after the early returns, ensuring it's always cleared when actually scheduling the job. Test verifies that Job.schedule() works correctly after cancel() when called on a running job. This reproduces the issue where the aboutToRunCanceled flag was not being cleared during reschedule. Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Test Results 1 947 files ±0 1 947 suites ±0 2h 0m 41s ⏱️ + 8m 49s For more details on these failures, see this check. Results for commit 3943cdf. ± Comparison against base commit 70d775d. ♻️ This comment has been updated with latest results. |
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
|
@iloveeclipse has pointed out, that job seems to start despite I had to create #2210 formulated in terms of Therefore the solution might be to fix Javadoc for |
|
|
||
| // The job should reschedule and not remain in NONE state | ||
| // Wait a bit to ensure the rescheduling happens | ||
| Thread.sleep(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not enough to reproduce a problem with getState() returning spurious Job.NONE. Why has this test failed in the first place?
| // Clear the about to run canceled flag when actually scheduling. | ||
| // A new explicit schedule() call should override any previous cancel() call. | ||
| // See https://github.com/eclipse-platform/eclipse.platform/issues/160 | ||
| job.setAboutToRunCanceled(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've managed to apply this delta and org.eclipse.core.tests.runtime.jobs.Bug_550738.testCancelSchedule() has started to fail. Does Copilot run any tests?
The aboutToRunCanceled flag was not being cleared when reschedule=true, causing jobs to be canceled instead of scheduled. This fix moves the flag clearing to after the early returns, ensuring it's always cleared when actually scheduling the job.
Test verifies that Job.schedule() works correctly after cancel() when called on a running job. This reproduces the issue where the aboutToRunCanceled flag was not being cleared during reschedule.
FYI @basilevs
Maybe we can build on this?