Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321751

Summary: Deadlock detector can be broken with cancellation and IJobManager#transferRule
Product: [Eclipse Project] Platform Reporter: James Blackburn <jamesblackburn+eclipse>
Component: RuntimeAssignee: platform-runtime-inbox <platform-runtime-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: min123, recoskie, yevshif
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
test 1 none

Description James Blackburn CLA 2010-08-04 11:52:32 EDT
Created attachment 175845 [details]
test 1

While attempting a fix for bug 262032 I discovered that transferring rules appears to break the DeadlockDetector if a thread blocked in beginRule is cancelled as the rule is transferred to it.

Simple IJobManager Test attached, I get this exception, and subsequent tests fail as the deadlock detector is disabled:

org.eclipse.core.runtime.AssertionFailedException: assertion failed: Thread main was not waiting for lock PathRule(testTransferToJobWithCancel) so it could not time out.

at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.internal.jobs.DeadlockDetector.lockWaitStop(DeadlockDetector.java:434)
at org.eclipse.core.internal.jobs.LockManager.removeLockWaitThread(LockManager.java:285)
at org.eclipse.core.internal.jobs.ThreadJob.waitEnd(ThreadJob.java:413)
at org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob.java:286)
at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:199)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:92)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285)
at org.eclipse.core.tests.runtime.jobs.IJobManagerTest.testTransferToJobWithCancel(IJobManagerTest.java:1765)


!ENTRY org.eclipse.core.jobs 4 2 2010-08-04 16:49:32.116
!MESSAGE LockManager.handleException
!STACK 0
java.lang.Exception:  :: 
 PathRule(testTransferToJobWithCancel),
 main :  1,
-------

at org.eclipse.core.internal.jobs.LockManager.handleInternalError(LockManager.java:204)
at org.eclipse.core.internal.jobs.LockManager.removeLockWaitThread(LockManager.java:288)
at org.eclipse.core.internal.jobs.ThreadJob.waitEnd(ThreadJob.java:413)
at org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob.java:286)
at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:199)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:92)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285)
at org.eclipse.core.tests.runtime.jobs.IJobManagerTest.testTransferToJobWithCancel(IJobManagerTest.java:1765)
Comment 1 James Blackburn CLA 2010-08-04 11:58:16 EDT
Adding Min to the CC as he was involved in the rule yielding / transfer stuff as part of bug 283449
Comment 2 Lars Vogel CLA 2019-11-14 02:21:42 EST
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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.