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

Bug 340412

Summary: UI blocked while opening menu
Product: [Technology] EGit Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Benjamin Muskalla <b.muskalla>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: b.muskalla, ilya.ivanov, jens.baumgart, matthias.sohn
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Steffen Pingel CLA 2011-03-18 07:19:16 EDT
I right clicked a menu item in the history view (I think) which blocked the UI thread for a while.

"main" prio=10 tid=0x08873800 nid=0x791e runnable [0xf6a0c000]
   java.lang.Thread.State: RUNNABLE
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850)
        at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1154)
        at java.net.InetAddress.getAllByName(InetAddress.java:1084)
        at java.net.InetAddress.getAllByName(InetAddress.java:1020)
        at java.net.InetAddress.getByName(InetAddress.java:970)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.isSameHosts(TaskReferenceFactory.java:196)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.getTaskRepositoryByHost(TaskReferenceFactory.java:157)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.getTaskRepositoryByGitRepoURL(TaskReferenceFactory.java:129)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.adaptFromRevCommit(TaskReferenceFactory.java:96)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.adaptFromObject(TaskReferenceFactory.java:61)
        at org.eclipse.egit.internal.mylyn.ui.commit.TaskReferenceFactory.getAdapter(TaskReferenceFactory.java:55)
        at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:326)
        at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(AdapterManager.java:356)
        at org.eclipse.ui.internal.LegacyResourceSupport.getAdapter(LegacyResourceSupport.java:622)
        at org.eclipse.ui.internal.ObjectActionContributor.isApplicableTo(ObjectActionContributor.java:223)
        at org.eclipse.ui.internal.ObjectContributorManager.isApplicableTo(ObjectContributorManager.java:303)
        at org.eclipse.ui.internal.ObjectActionContributorManager.contributeObjectActions(ObjectActionContributorManager.java:83)
        at org.eclipse.ui.internal.PopupMenuExtender.addObjectActions(PopupMenuExtender.java:262)
        at org.eclipse.ui.internal.PopupMenuExtender.menuAboutToShow(PopupMenuExtender.java:339)
        at org.eclipse.jface.action.MenuManager.fireAboutToShow(MenuManager.java:338)
        at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:469)
        at org.eclipse.jface.action.MenuManager.access$1(MenuManager.java:465)
        at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:491)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:247)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263)
        at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:199)
        at org.eclipse.swt.widgets.Display.runPopups(Display.java:3609)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3186)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        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:622)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Jens Baumgart CLA 2011-03-22 11:12:01 EDT
I think such stuff should not be done in the UI thread.
If it takes long time to calculate enablement then enablement should be true by default and action execution should then check afterwards.
Comment 2 Benjamin Muskalla CLA 2011-04-28 03:51:51 EDT
Yes, this is blocking my Eclipse several times a day while working with the Sync view. Will take care of this
Comment 3 Matthias Sohn CLA 2011-05-02 12:08:41 EDT
merged as 63aa1303c6b9b66da534bb45b33c20f963ce7e84
included in 0.12