Bug 321398

Summary: Deadlock occuring due to ModuleStructuralModel.checkSync()
Product: [WebTools] WTP Common Tools Reporter: Carl Anderson <ccc>
Component: wst.commonAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Carl Anderson <ccc>
Severity: critical    
Priority: P1 Flags: ccc: review+
Version: 3.2.1   
Target Milestone: 3.2.0 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Go to the LocalManager to do the refresh
none
Cleaned up version - only go to the LocalManager none

Description Carl Anderson CLA 2010-07-30 15:25:56 EDT
In an adopter product, we are running into the circumstance where a process that already has a lock on a file, and the component file is out of sync with the filesystem, is calling into ModuleStructuralModel.checkSync().  When Job.getJobManager().beginRule(root, null); is called, this results in the thread waiting for itself (since it cannot get a workspace lock while it already has a file lock), and thus a deadlock occurs.
Comment 1 Carl Anderson CLA 2010-07-30 15:27:26 EDT
Created attachment 175608 [details]
Go to the LocalManager to do the refresh
Comment 2 Carl Anderson CLA 2010-07-30 15:30:42 EDT
Note that this code brings ModuleStructuralModel.checkSync() in sync with the way org.eclipse.jst.j2ee.common.internal.impl.XMLResourceImpl synchronizes files.

see bug 303635 for details on the XMLResourceImpl change.
Comment 3 Carl Anderson CLA 2010-07-30 16:18:05 EDT
Created attachment 175613 [details]
Cleaned up version - only go to the LocalManager

I left in the release of the lock I was no longer acquiring.
Comment 4 Carl Anderson CLA 2010-08-02 11:22:28 EDT
Committed to R3_2_1_patches