Bug 59291 - Deadlock between AllTypes cache and setClasspathContainer
Summary: Deadlock between AllTypes cache and setClasspathContainer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 59600 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-20 12:24 EDT by Dani Megert CLA
Modified: 2004-05-19 07:56 EDT (History)
1 user (show)

See Also:


Attachments
thread dump (25.75 KB, text/plain)
2004-04-20 12:25 EDT, Dani Megert CLA
no flags Details
Just the two blocking threads (20.43 KB, text/plain)
2004-04-21 03:48 EDT, Andre Weinand CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-04-20 12:24:37 EDT
I20040420

Deadlock happens because
1a. main thread locks JavaModelManager
1b. AllTypes cache locks via rule (some resources)
2a. main thread want lock for some resources that got locked in 1b
2b. AllTypes cache wants lock on JavaModelManager
Comment 1 Dani Megert CLA 2004-04-20 12:25:29 EDT
Created attachment 9716 [details]
thread dump
Comment 2 Andre Weinand CLA 2004-04-21 03:48:44 EDT
Created attachment 9754 [details]
Just the two blocking threads
Comment 3 Andre Weinand CLA 2004-04-21 03:56:02 EDT
It seems that the deadlock does not occur in the AllTypesCache code but inside jdt.core:
the code to compute the resolved classpath seems to lock the JavaModelManager and some resources 
inconsistently.
I've tried to aquire the  JavaModelManager lock before starting a Search, but this wasn't too succesful 
and I don't think that this is the right approch anyway.

Your comment?
Comment 4 Philipe Mulet CLA 2004-04-21 06:37:56 EDT
This is a consequence of the thread safety protection we added to resolve bug 
57886.
Comment 5 Philipe Mulet CLA 2004-04-21 07:22:44 EDT
Deferred container persistence until save operation is performed.
Thus the blocking question is only asked outside the JavaModelManager lock.

Comment 6 Philipe Mulet CLA 2004-04-21 07:23:13 EDT
Fixed
Comment 7 Andre Weinand CLA 2004-04-22 09:41:32 EDT
*** Bug 59600 has been marked as a duplicate of this bug. ***
Comment 8 Frederic Fusier CLA 2004-05-19 07:56:40 EDT
Verified for 3.0 M9 with build I200405190010.