Closed GlennPlou closed 2 months ago
@GlennPlou please see https://github.com/eclipse-capella/capella/pull/2895
IMO, the issue is in Capella's post refresh extensions and not in this API. Refresh extensions in Capella should not use the helper but retrieve the DialectEditor in a non blocking way
For your suggestion: the change from sync to async performed in GMF actions was intended to delay the internal refresh methods of some actions and let them refresh their UI when UI Thread is available, in a non blocking way.
Here the goal is to return the ActiveWindows, and in the Capella post refresh extensions to get the DiagramEditor in order to be able to find its edit part registry. You will see on the PR proposed for Capella that it is possible to tget the dialect editor (active or not) for the currently refreshed diagram.
Issue comes from Capella and their FunctionalChains. We don't have to change anything here in Sirius. See https://github.com/eclipse-capella/capella/pull/2895/
A deadlock has been identified in Team for Capella, the stack trace refers to the actual
workbench.getDisplay().syncExec(getActiveWorkbenchWindowRunnable);
code snippet made inorg.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.getActiveWindow()
. I was not able to reproduce in a Sirius context, but here are the steps to reproduce:In-Flight Entertainment System
and open the shared project.[LAB][CTX] *
diagrams (they have functional chains)Logical Actor
in one diagram, save.Logical Actor
, save. K-O: save is not completed, an error in the error log is throw, here is a part of the error:java.lang.IllegalStateException: Call stack for thread Worker-2: Saving In-Flight Entertainment System.team.aird at java.management@17.0.7/sun.management.ThreadImpl.dumpThreads0(Native Method) at java.management@17.0.7/sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:485) at org.eclipse.ui.internal.UILockListener.reportInterruption(UILockListener.java:214) at org.eclipse.ui.internal.UILockListener.interruptUI(UILockListener.java:180) at org.eclipse.ui.internal.PendingSyncExec.waitUntilExecuted(PendingSyncExec.java:92) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:142) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4785) at org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.getActiveWindow(EclipseUIUtil.java:65) at org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.getActivePage(EclipseUIUtil.java:81) at org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.getActiveEditor(EclipseUIUtil.java:94) at org.polarsys.capella.core.sirius.analysis.DiagramServices.getEditPart(DiagramServices.java:2103) at org.polarsys.capella.core.sirius.analysis.DiagramServices.refreshBeginEndLabels(DiagramServices.java:2124) at org.polarsys.capella.core.sirius.analysis.FunctionalChainServices.customizeFunctionalExchangeEdgeLabels(FunctionalChainServices.java:359) at org.polarsys.capella.core.sirius.analysis.FunctionalChainServices.updateFunctionalChainStyles(FunctionalChainServices.java:330) at org.polarsys.capella.core.sirius.analysis.refresh.extension.ComponentArchitectureBlankRefreshExtension.postRefresh(ComponentArchitectureBlankRefreshExtension.java:475) at org.eclipse.sirius.diagram.business.api.refresh.RefreshExtensionService.safePostRefresh(RefreshExtensionService.java:251) at org.eclipse.sirius.diagram.business.api.refresh.RefreshExtensionService.postRefresh(RefreshExtensionService.java:146) at org.eclipse.sirius.diagram.business.internal.sync.DDiagramSynchronizer.refreshOperation(DDiagramSynchronizer.java:398) at org.eclipse.sirius.diagram.business.internal.sync.DDiagramSynchronizer.refresh(DDiagramSynchronizer.java:316) at org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices.refresh(DiagramDialectServices.java:243) at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.refresh(DialectManagerImpl.java:106) at org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.doExecute(RefreshRepresentationsCommand.java:122)