Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #191193 +++ Build ID: JSDT 3.3.1 / o.e.wst.jsdt.ui_1.1.101.v201108151912 I'm getting the following error logged reproducably in my workspace on startup, and I'm assuming that it degrades startup performance: While loading class "org.eclipse.wst.jsdt.internal.ui.InitializeAfterLoadJob$RealJob", thread "Thread[main,6,main]" timed out waiting (5000ms) for thread "Thread[Worker-4,5,main]" to finish starting bundle "org.eclipse.wst.jsdt.ui_1.1.101.v201108151912 [654]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "org.eclipse.wst.jsdt.internal.ui.InitializeAfterLoadJob$RealJob" may not be fully initialized. Doing a little bit of investigation shows that this is exactly the same problem which JDT fixed in bug 191193 : The jsdt.ui#start() method schedules InitializeAfterLoadJob, and in some cases it can happen that the UI (Display.asyncExec / main Thread) schedules that Job before the start() method is finished. The fix is easy -- same as in JDT, just move the new InitializeAfterLoadJob().schedule(); to the very end of the start() method.
Created attachment 203483 [details] patch v1 Attached simple patch fixes the issue.
For more improvements which JDT has already applied to its start() method and which could probably be applied to JSDT as well, see bug 127085: // make sure org.eclipse.jdt.core.manipulation is loaded too // can be removed if JavaElementPropertyTester is moved down to jdt.core (bug 127085) JavaManipulation.class.toString(); As well as bug 199135 -- jdt.ui/JavaPlugin.java v1.206.2.1 (Encapsulate stuff in PlatformUI.isWorkbenchRunning()
JFYI, JSDT bug 258423 also has the timeout in its backtrace. Not sure it's related to that issue though, but it might be.
Martin's analysis looks correct. It would be good to get this fixed. Note that Java 7 support for parallel class loaders in equinox should avoid this kind of deadlock.
ping
Ping, could my patch please be considered ? Indigo SR 2 is approaching quickly and this should really be in.
Committed to R3_3_maintenance and HEAD. Thanks, Martin!