Community
Participate
Working Groups
I accidentally restarted Eclipse Workbench with activated task and it froze UI for quite some time after that restart. From the thread dump there is some JDT code triggered from within UI thread. I think this stuff should be moved out of the UI thread. On the other hand, JDT and generally workbench is trying to minimize startup time, so maybe Mylar should not reactivate task after startup. "main" prio=6 tid=0x00296000 nid=0xc70 in Object.wait() [0x0090e000..0x0090fe5c] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x0e0bca48> (a org.eclipse.core.internal.jobs.Semaphore) at org.eclipse.core.internal.jobs.Semaphore.acquire(Semaphore.java:38) - locked <0x0e0bca48> (a org.eclipse.core.internal.jobs.Semaphore) at org.eclipse.core.internal.jobs.OrderedLock.doAcquire(OrderedLock.java:169) at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:105) at org.eclipse.core.internal.jobs.OrderedLock.acquire(OrderedLock.java:82) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:118) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1744) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1792) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:785) at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4519) at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:69) at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2203) at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1545) at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:1571) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2558) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1848) at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:395) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:229) at org.eclipse.jdt.internal.core.Openable.openParent(Openable.java:423) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:218) at org.eclipse.jdt.internal.core.Openable.openParent(Openable.java:423) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:218) at org.eclipse.jdt.internal.core.Openable.openParent(Openable.java:423) at org.eclipse.jdt.internal.core.CompilationUnit.openParent(CompilationUnit.java:1102) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:218) at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:107) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:505) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:249) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:235) at org.eclipse.jdt.internal.core.JavaElement.exists(JavaElement.java:153) at org.eclipse.mylar.internal.java.ui.JavaUiBridge.open(JavaUiBridge.java:60) at org.eclipse.mylar.internal.resources.ui.ContextEditorManager.contextActivated(ContextEditorManager.java:101) at org.eclipse.mylar.internal.context.core.ContextManager.activateContext(ContextManager.java:443) at org.eclipse.mylar.tasks.ui.TasksUiPlugin$1.taskActivated(TasksUiPlugin.java:208) at org.eclipse.mylar.tasks.ui.TaskListManager.activateTask(TaskListManager.java:848) at org.eclipse.mylar.tasks.ui.TasksUiPlugin$8.run(TasksUiPlugin.java:446) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) - locked <0x0daba068> (a org.eclipse.swt.widgets.RunnableLock) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
Yes, reactivating a task can trigger JDT and other activation. But I think that it is required given the rule that the workbench should be restored to the state that it was left in when closed. If we don't re-activate the task we are forcing the user to figure out what they were last doing when they closed. Also, if the user wants a faster startup they can deactivate the task before shutdown (although that's not a great answer).
Mik, the ContextManager.activateContext() call in the shown stack trace should not be happening from the UI thread. So, workbench window won't go gray for several minutes. So, please reconsider priority of this issue.
Sounds good, took task activation and deactivation out of the UI thread. After today's dev build comes out let me know if you see any change in the performance profile or startup/activation.
Created attachment 68626 [details] mylar/context/zip
Mik, your change to wrap activation into PlatformUI.getWorkbench().getDisplay().asyncExec(...); don't move execution out of the UI thread. From the javadoc of that method: Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. I you probably should use a background job instead.
Argh, I did this too rushed and made it asynchronous in the UI thread instead of taking it out of the UI thread as expected. The UI is intended to effectively block during task activation, so I'm not planning on making it run in a background thread and instead we can look at optimizing task activation times since no specific optimization has been done (beyond the editor memento work).
Btw, I removed those useless async execs.
And thanks for catching this mistake.
(In reply to comment #6) > The UI is intended to effectively block during task activation, so I'm not planning on making it run in a > background thread and instead we can look at optimizing task activation times > since no specific optimization has been done (beyond the editor memento work). Hmm. I would agree that UI need to be blocked when editors are being restored, but stuff that loading context and kicking JDT activation could happens in the background job. There are plenty activities that user can do in the ide during that time. I.e. review and update from sync view or browse trough task list.
Should this be closed? from the comments it seems to have been completed.
Mylyn has been restructured, and our issue tracking has moved to GitHub [1]. We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub. [1] https://github.com/orgs/eclipse-mylyn