Bug 544558 - ConcurrentModificationException in AcceleoMTLInterpreter when using EEF-based properties views
Summary: ConcurrentModificationException in AcceleoMTLInterpreter when using EEF-based...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 6.1.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 542859
  Show dependency tree
 
Reported: 2019-02-19 02:45 EST by Pierre-Charles David CLA
Modified: 2019-02-19 02:46 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2019-02-19 02:45:26 EST
When using a Sirius modeler which uses A3/MTL expressions, if I refresh the diagram while the properties view (using the default EEF-based rules) is visible, I often get this stack trace:

Caused by: java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
	at java.util.HashMap$EntryIterator.next(HashMap.java:1476)
	at java.util.HashMap$EntryIterator.next(HashMap.java:1474)
	at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1428)
	at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1417)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.createCompilationContext(AcceleoMTLInterpreter.java:519)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.internalEvaluate(AcceleoMTLInterpreter.java:1154)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.evaluateString(AcceleoMTLInterpreter.java:701)
	at org.eclipse.sirius.tools.internal.interpreter.SessionInterpreter.evaluateString(SessionInterpreter.java:301)

I'll complete with proper reproduction steps later, but my current analysis of what happens (to be confirmed):
* the "Refresh" operation requested by the end-user is launched in a separate job, and thus run out of the UI thread;
* while the refresh is executing in that thread, the UI thread continues processing UI events, and in particular at some point refreshes the properties view;
* inside the UI thread (what's important is that it is a separate thread that the one executing the refresh, not that it is *the* UI thread), EEF uses the SessionInterpreter to evaluate expressions, which requires setting/unsetting variables;
* because the modeler uses MTL expressions, the SessionInterpter has an instance of AcceleoMTLInterpreter instanciated, to which it forwards all requests to set/unset variables;
* if these requests by EEF from the UI thread happen to overlap with the evaluation of MTL expressions from inside the refresh, and thus another thread, the way createCompilationContext accesses the "current variables" detects a concurrent change and throws the exception.