| Summary: | Deadlock initializing legacy J2EE EMF models | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Java EE Tools | Reporter: | Carl Anderson <ccc> | ||||||
| Component: | jst.j2ee | Assignee: | Carl Anderson <ccc> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Chuck Bridgham <cbridgha> | ||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | Dimo.Stoilov, jsholl, rsc | ||||||
| Version: | 3.2 | Flags: | cbridgha:
review+
|
||||||
| Target Milestone: | 3.2.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 319020 | ||||||||
| Attachments: |
|
||||||||
|
Description
Carl Anderson
Created attachment 170687 [details]
Make the initialization directed
Simply put, instead of the initialization of any entry point causing everything to be initialized (which can deadlock if two initializations are waiting for each other), I am making the model initialization a directed initialization- each model element initializes all of the models it requires, and then it calls to J2EEInit(), which does a "bottom up" initialization of everything on a separate thread.
Note that during the initialization, which requires being in a constructor, it is illegal to call wait(). Calling sleep() can cause one thread to wait, but it will not allow re-entrance into the constructor that is already in progress. Therefore, the full initialization should happen on its own thread, and still following the directed approach. (I chose the order that is in there because it will initialize things at the lowest level first, which reduces the risk of another thread waiting for initialization- if most of the required models of a particular EMF model are already initialized, its initialization should be quick and will be less likely to wait.
The separate initialization is guarded to only happen once.
approved *** Bug 290696 has been marked as a duplicate of this bug. *** Committed to HEAD for WTP 3.2.1 and WTP 3.3 *** Bug 326272 has been marked as a duplicate of this bug. *** Still get the deadlock with Version: Helios Service Release 1 Build id: 20100917-0705 See Eclipse-20100917-0705-Deadlock.txt Monitor of EJBResourceImpl.getRootTranslator never released. Created attachment 181626 [details]
Thread Dump from VisualVM
Stephan - please open a separate defect for your issue. The problem that you are encountering comes from commonarchive, which needs to conform to the same rules as the J2EE models. (And please attach the thread dump to that new bug.) |