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

Bug 545853

Summary: Avoid a dead lock while selecting the new created element(s) in a diagram
Product: [Modeling] Sirius Reporter: Florian Barbin <florian.barbin>
Component: DiagramAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jerome.pequery, laurent.fasani
Version: 6.1.1   
Target Milestone: 6.1.3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/139611
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4e9117181bb73c3898fe1b4e9153febc104eb469
https://git.eclipse.org/r/140483
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=32443373e5e8481c7a512a715d0e0afa7355e64e
Whiteboard:
Bug Depends on:    
Bug Blocks: 546186    

Description Florian Barbin CLA 2019-03-27 11:30:53 EDT
In org.eclipse.sirius.ui.tools.internal.editor.SelectDRepresentationElementsListener.resourceSetChanged(ResourceSetChangeEvent), we indirectly perform a Display.syncExec to retrieve the current active editor (org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.getActiveEditor()).
As we are retaining the current EMF Transaction (the transaction lock is released once the postCommit() is executed) that could potentially cause a deadlock.
For instance, when performing a manual refresh on a diagram, new graphical elements can be created. In the case of Capella for instance, the org.polarsys.capella.core.ui.properties.CapellaDataListenerForPropertySections is notified and schedule the refresh of the properties view within the UI thread. This refresh try to acquire the lock on the transaction but this one is kept by the Sirius refresh job and this job is waiting for the ui thread in electDRepresentationElementsListener.resourceSetChanged.
More generally, we should never wait for the UI thread in a thread that has a lock on some resources.

Validation: There is no Sirius use case to reproduce this issue.
Comment 1 Eclipse Genie CLA 2019-03-27 11:36:44 EDT
New Gerrit change created: https://git.eclipse.org/r/139611
Comment 3 Eclipse Genie CLA 2019-04-12 05:35:40 EDT
New Gerrit change created: https://git.eclipse.org/r/140483
Comment 5 Jerome Pequery CLA 2019-05-28 04:49:03 EDT
Validated with T4C 1.3.1 IT7
Comment 6 Pierre-Charles David CLA 2019-06-17 10:47:11 EDT
Available in Sirius 6.1.3, see https://wiki.eclipse.org/Sirius/6.1.3