Bug 278425 - Deadlock on startup when m2eclipse and AJDT are used on same project
Summary: Deadlock on startup when m2eclipse and AJDT are used on same project
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 2.0.1   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-29 13:06 EDT by Andrew Eisenberg CLA
Modified: 2009-09-24 18:36 EDT (History)
0 users

See Also:


Attachments
Thread dump of deadlock (57.96 KB, application/octet-stream)
2009-05-29 13:06 EDT, Andrew Eisenberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2009-05-29 13:06:14 EDT
From an email:

There seems to be a race between AJDT and m2eclipse at 
startup which is causing a deadlock on the splash screen. See attached 
thread dump.

This happens when I have some entities from a roo project open which 
has AJDT and m2eclipse support enabled and restart.
Comment 1 Andrew Eisenberg CLA 2009-05-29 13:06:55 EDT
Created attachment 137685 [details]
Thread dump of deadlock
Comment 2 Andrew Eisenberg CLA 2009-05-29 13:07:24 EDT
Eyeballing that part of the AJDT code right now, it seems that this problem occurs only when JDT weaving is disabled.  It's a bunch of code that I've always wanted to get rid of, but can't in order to make sure that AJDT still functions reasonably well with JDT weaving disabled.

I'm trying right now to see if I can avoid this race condition.
Comment 3 Andrew Eisenberg CLA 2009-05-29 13:07:34 EDT
Not able to reproduce this.  However, I notice that the log you sent shows that the deadlock occurs when both AJDT and m2eclipse are in their startup methods.  I could put some logic in AJDT's start method that it should wait for m2eclispe to start first (if it is present in the workspace).
Comment 4 Andrew Eisenberg CLA 2009-05-29 13:34:19 EDT
It is straight forward to ensure that the m2eclipse bundle is started before AJDT bundle is.  However, perhaps this should go in a separate thread because OSGi will throw a BundleException if a BundleActivator's time to start is too long.  I don't want AJDT's time to start depending on m2eclipse's time to start.
Comment 5 Andrew Eisenberg CLA 2009-05-29 14:03:38 EDT
OK...made a change to AspectJUIPlugin so that now AJCompilationUnitManager.INSTANCE.initCompilationUnits(AspectJPlugin.getWorkspace()); is called in a separate job.  Also, before this is called, the job ensures that m2eclipse has finished its starting (if it exists).

Going to wait to hear back from the reporter of this bug before closing.
Comment 6 Andrew Eisenberg CLA 2009-06-25 14:06:43 EDT
Not reproducible after changes have been made.