Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314343 - [console] IllegalStateException can happen on shutdown if you disconnect from standard console
Summary: [console] IllegalStateException can happen on shutdown if you disconnect from...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.6.1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 15:43 EDT by Thomas Watson CLA
Modified: 2010-06-28 10:26 EDT (History)
1 user (show)

See Also:


Attachments
patch (977 bytes, patch)
2010-06-28 10:07 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2010-05-25 15:43:08 EDT
This is related to the fix in bug312917.

If you run with -console (with no port option) and then run the disconnect command you will get the following stack trace in the log:

java.lang.IllegalStateException: The service has been unregistered
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:209)
	at org.eclipse.osgi.framework.internal.core.ConsoleManager.stopConsole(ConsoleManager.java:162)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:412)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:198)
	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:331)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Thomas Watson CLA 2010-05-25 15:43:58 EDT
Should fix in 3.6.1.
Comment 2 Markus Keller CLA 2010-06-28 06:32:48 EDT
I got this exception in N20100620-2000 during a normal shutdown. Looks like it's not just a log entry, but interrupts the normal shutdown. At least the CVS plug-in did not shut down properly, and I lost all the newly-created change sets from that session (bug 98299).

I could not reproduce with N20100627-2000, so it looks like this bug is also timing-dependent.
Comment 3 Markus Keller CLA 2010-06-28 06:41:47 EDT
I launch with -clean -consolelog -showlocation -console -debug. The workbench was up for several days, and I did a lot of different things with this instance (e.g. traced it with YourKit). I don't think I've interacted with the console in other ways than pressing Ctrl+Break.
Comment 4 Thomas Watson CLA 2010-06-28 10:07:39 EDT
Created attachment 172907 [details]
patch

(In reply to comment #3)
> I launch with -clean -consolelog -showlocation -console -debug. The workbench
> was up for several days, and I did a lot of different things with this instance
> (e.g. traced it with YourKit). I don't think I've interacted with the console
> in other ways than pressing Ctrl+Break.

Was the osgi> console still functional after pressing Ctrl-Break?  I suspect the console gets disconnected similar to if you ran the disconnect command.  This would explain the exception on shutdown.  You are correct, this exception would prevent the proper shutdown of the framework.

This patch protects against this.
Comment 5 Thomas Watson CLA 2010-06-28 10:18:05 EDT
Patch released to HEAD and to 3.6.1.
Comment 6 Markus Keller CLA 2010-06-28 10:26:22 EDT
(In reply to comment #4)
> Was the osgi> console still functional after pressing Ctrl-Break?

Indeed, osgi> console is dead after Ctrl+Break, and after that, the exception is thrown on shutdown.