Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329662 - [tcf]IllegalStateException while shutting down Eclipse with unfolded processes/files list
Summary: [tcf]IllegalStateException while shutting down Eclipse with unfolded processe...
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.0.0   Edit
Assignee: Project Inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-08 05:52 EST by Anna Dushistova CLA
Modified: 2013-06-05 06:11 EDT (History)
2 users (show)

See Also:


Attachments
Catching the exception in isConnected() (1.86 KB, patch)
2011-04-28 04:05 EDT, Uwe Stieber CLA
mober.at+eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Dushistova CLA 2010-11-08 05:52:39 EST
I noticed that an exception is thrown at the moment you shut down Eclipse if you have an unfolded processes list in your connection.The same happens for files subsystem. Here is the stack for processes:
!ENTRY org.eclipse.rse.ui 4 0 2010-11-08 13:47:52.760
!MESSAGE Error disconnecting for org.eclipse.tm.tcf.rse.Processes
!STACK 0
java.lang.IllegalStateException: TCF event dispatcher has shut down
	at org.eclipse.tm.tcf.EventQueue.invokeLater(EventQueue.java:110)
	at org.eclipse.tm.tcf.protocol.Protocol.invokeAndWait(Protocol.java:219)
	at org.eclipse.tm.internal.tcf.rse.TCFConnectorService.isConnected(TCFConnectorService.java:122)
	at org.eclipse.rse.core.subsystems.SubSystem.isConnected(SubSystem.java:2086)
	at org.eclipse.rse.core.subsystems.SubSystemConfiguration.disconnectAllSubSystems(SubSystemConfiguration.java:1478)
	at org.eclipse.rse.ui.RSEUIPlugin.disconnectAll(RSEUIPlugin.java:534)
	at org.eclipse.rse.ui.RSEUIPlugin.stop(RSEUIPlugin.java:506)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:843)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:836)
	at org.eclipse.osgi.framework.internal.core.BundleHost.stopWorker(BundleHost.java:474)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.suspend(AbstractBundle.java:546)
	at org.eclipse.osgi.framework.internal.core.Framework.suspendBundle(Framework.java:1098)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.decFWSL(StartLevelManager.java:593)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:261)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.shutdown(StartLevelManager.java:216)
	at org.eclipse.osgi.framework.internal.core.InternalSystemBundle.suspend(InternalSystemBundle.java:266)
	at org.eclipse.osgi.framework.internal.core.Framework.shutdown(Framework.java:685)
	at org.eclipse.osgi.framework.internal.core.Framework.close(Framework.java:583)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:409)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:200)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Comment 1 Uwe Stieber CLA 2011-04-28 04:05:10 EDT
Created attachment 194241 [details]
Catching the exception in isConnected()

Eclipse does not guarantee an order while shutting down the plug-in's/bundles. In this case, the TCF core plug-in wen't down before the RSE UI plug-in. The most obvious patch for this case, to avoid the exception thrown to the users attention, is to catch it in "TCFConnectorService.isConnected()" (see attached patch).

The more desirable way would be to have a callback like the "startup" extension point, where plug-in's can register and get called back once the TCF core plug-in is shut down. Or extending the "startup" extension point to serve both start and stop. Probably worth a separate enhancement request.
Comment 2 Eugene Tarassov CLA 2011-11-29 13:28:59 EST
I have committed the patch.

> The more desirable way would be to have a callback like the "startup" extension
point, where plug-in's can register and get called back once the TCF core
plug-in is shut down.

Such callback is already provided by OSGi API (e.g. BundleListener). Implementing another one in TCF would be redundant.
Comment 3 Martin Oberhuber CLA 2013-05-23 19:20:39 EDT
Comment on attachment 194241 [details]
Catching the exception in isConnected()

Uwe has been a committer since 2011-09-30 , thus marking attached patch as iplog-