Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362288

Summary: BundleStatusException when using sqltools.editor.core Plug-In (Deadlock?)
Product: [Tools] Data Tools Reporter: Florian Albrecht <cw.florian.albrecht>
Component: SQLDevToolsAssignee: Brian Payton <bpayton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bpayton
Version: unspecified   
Target Milestone: 1.10   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test project producing the bug
none
Proposed patch to remove deadlock bpayton: iplog+

Description Florian Albrecht CLA 2011-10-28 06:03:51 EDT
Build Identifier: 20100617-1415

When using the org.eclipse.datatools.sqltools.editor.core Plug-In in a non-GUI application, a BundleStatusException occurs when executing that application. After investigating in the code, it looks pretty much like a deadlock in the init() code of the SQLDevToolsConfigRegistryImpl class (it is quite confusing code, by the way - why doing all this stuff in anonymous threads?).


Reproducible: Always

Steps to Reproduce:
1. Create an empty Plug-In project depending only on org.eclipse.core.runtime and org.eclipse.datatools.sqltools.editor.core. Add an application which only calls ProfileUtil.getProfiles(). I will attach an example project.

2. Create a run configuration (as "Eclipse Application") which executes this application and add only required plug-ins. 

3. Run this application.
Comment 1 Florian Albrecht CLA 2011-10-28 06:06:21 EDT
Created attachment 206122 [details]
Test project producing the bug

Here is the test project. Create a run configuration as described above to reproduce the bug.
Comment 2 Florian Albrecht CLA 2011-11-11 06:09:14 EST
Created attachment 206835 [details]
Proposed patch to remove deadlock

Okay, as nobody seems to care, here is a patch proposal. I still don't know why the listener calls are threaded, but maybe there is database work or similar to be expected. 
Anyway, I added tool code which waits for the EditorCorePlugin to startup if it is still starting. This tool code is called by the listener notification threads, so deadlock situations for the Eclipse Classloader should not occur anymore.
Comment 3 Brian Payton CLA 2012-01-24 16:20:45 EST
Sorry for the lack of response.  The original code for this plugin was contributed by Sybase, and the Sybase committers disappeared when Sybase withdrew from open source activities a couple of years ago.

I'll take a look at the patch, but I don't know this part of the code very well.
Comment 4 Brian Payton CLA 2012-05-17 21:34:56 EDT
The fix looks OK as far as I can tell.  I did some basic testing didn't see any new problems.  I've checked the change into DTP 1.10.  Here's the Git commit record:
http://git.eclipse.org/c/datatools/org.eclipse.datatools.sqltools.git/commit/?id=8d103b6c9c55e5ad6aa0e7019cbcef20c19e3173