Showing posts with label time out. Show all posts
Showing posts with label time out. Show all posts

Thursday, November 27, 2014

Changing the Eclipse Java thread time out value


Did you ever face below kind of issue while starting your eclipse product ? 

!ENTRY org.eclipse.osgi 2 0 2014-11-28 11:17:57.835
!MESSAGE While loading class "com.kk.tool.model.KContainer", thread "Thread[main,6,main]" timed out waiting (5015ms) for thread "Thread[Thread-3,5,main]" to finish starting bundle "com.kk.tool_6.0.190.DEV_v201411271801 [664]". To avoid deadlock, thread "Thread[main,6,main]" is proceeding but "com.kk.tool.model.KContainer" may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle "reference:file:dropins/com.kk.tool_6.0.190.DEV_v201411271801.jar" by thread "Thread-3


There are two majors reasons for this.
1. Real dead lock would have occurred
2. Your product might have lot of bundles and each one of them might have dependencies on other plugins startup. Because of this, eclipse startup will be delayed.

If it is (1), we need to identify the root cause for a dead lock and fix it.

In general, OSGI controlling java threads time out by 5000 ms by default. We can control this time out by osgi parameter which need to be configured in the config.ini file.

equinox.statechange.timeout=8000

You can find config.ini file in the configuration folder of eclipse directory.
<eclipse>/configuration/config.ini

Caution: Don't jump strait to the timeout solution with out really looking at the dead lock possibility, 99% of time problem might be there with our code only!!!!

Resources: