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

Bug 29212

Summary: CVS Decorator causes deadlock during builds
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: TeamAssignee: Platform-VCM-Inbox <platform-vcm-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: jeem, john.arthorne, n.a.edgar, philippe_mulet
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 29192    

Description Tod Creasey CLA 2003-01-09 10:43:38 EST
20030107

The CVSDecorator causes deadlock if a build is going on in another process. 
Refer to Bug 29192 for stack traces.

CVS is accessed via 2 threads

1) A builder thread which is trying to acquire the CVS lock in 
ReentrantLock.acquire as a result of a resource change. The builde already has 
the Workspace lock.

2) The decorator thread which is currently serving the CVS Decorator. It has 
already acquired the CVS lock and it trying to get the workspace lock in order 
to get synchInfo (see SynchronizerSyncInfoCache.setCache).
Comment 1 Michael Valenta CLA 2003-01-09 16:09:40 EST
Fix released to HEAD. The CVS decorator will now obtain the workspace lock 
before obtaining the CVS lock.
Comment 2 Nick Edgar CLA 2003-01-09 16:49:06 EST
I'm curious: how are you obtaining the workspace lock? IWorkspace.run?
Comment 3 Michael Valenta CLA 2003-01-10 08:29:37 EST
To my knowledge, that is the only way. Is there another way? 
Comment 4 Nick Edgar CLA 2003-01-10 11:46:27 EST
Not that I know of.  But beware that this can trigger an autobuild too.
Comment 5 Michael Valenta CLA 2003-01-10 12:11:11 EST
I have run some tests to validate that the autobuild will only be triggered if 
changes to the resource tree are actually made. We have identified one such 
case and will modify the code so the resource tree is not effected (see bug 
29250).
Comment 6 John Arthorne CLA 2003-01-10 14:29:22 EST
IWorkspace.run is the only way to acquire the workspace lock for a particular
duration.  I can also confirm that IWorkspace.run will not trigger an autobuild,
unless another workspace operation is called from inside the IWorkspaceRunnable.
Comment 7 Michael Valenta CLA 2003-01-14 09:00:23 EST
*** Bug 29434 has been marked as a duplicate of this bug. ***