Bug 571543 - Invalid thread access at sequence EditPartRefresh
Summary: Invalid thread access at sequence EditPartRefresh
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 6.4.2   Edit
Assignee: Laurent Fasani CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 571610
  Show dependency tree
 
Reported: 2021-02-26 09:51 EST by Laurent Fasani CLA
Modified: 2021-03-18 04:44 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Fasani CLA 2021-02-26 09:51:31 EST
The post commit listener org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.part.SequenceDiagramEditPart.refreshZorder do the refresh of the edit parts contained in the sequence diagram.

The test SequenceExecutionBasicAndReturnMessageTest is broken because when the transaction is executed in a non UI Thread then the post commit is also executed in the no UIThread which lead to SWTException Invalid thread access.

The fi consists in executing the edit part refresh in the UI thread
Comment 1 Eclipse Genie CLA 2021-02-26 09:54:06 EST
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/176940
Comment 2 Laurent Fasani CLA 2021-02-26 10:08:42 EST
Calling the code in syncExec on UI thread is not sufficient because we get a 

	at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.java:419)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.acquire(TransactionalEditingDomainImpl.java:580)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.activate(TransactionalEditingDomainImpl.java:508)
	at org.eclipse.emf.transaction.impl.TransactionImpl.start(TransactionImpl.java:204)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.startTransaction(TransactionalEditingDomainImpl.java:424)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:321)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:852)

An AsyncExec fixes the issue
Comment 3 Eclipse Genie CLA 2021-03-02 01:48:09 EST
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/177031
Comment 5 Maxime Porhel CLA 2021-03-05 04:23:28 EST
Steps to validate: 
 - check the result of SequenceExecutionBasicAndReturnMessageTest
Comment 6 Pierre-Charles David CLA 2021-03-08 03:38:00 EST
Verified on 6.4.2rc3.
Comment 7 Pierre-Charles David CLA 2021-03-18 04:44:42 EDT
Available in Sirius 6.4.2: http://download.eclipse.org/sirius/updates/releases/6.4.2