Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow latency analysis crashes when run from instance model editor #2013

Closed
AaronGreenhouse opened this issue Oct 8, 2019 · 2 comments · Fixed by #2016
Closed

Flow latency analysis crashes when run from instance model editor #2013

AaronGreenhouse opened this issue Oct 8, 2019 · 2 comments · Fixed by #2016

Comments

@AaronGreenhouse
Copy link
Contributor

@AaronGreenhouse AaronGreenhouse commented Oct 8, 2019

Running "Check Flow Latency" analysis on my iMac fails with an exception

java.lang.IllegalStateException: Cannot modify resource set without a write transaction
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:349)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:303)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:273)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:239)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:261)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:304)
	at org.osate.analysis.flows.FlowLatencyUtil.saveAnalysisResult(FlowLatencyUtil.java:544)
	at org.osate.analysis.flows.handlers.CheckFlowLatency.finalizeAnalysis(CheckFlowLatency.java:130)
	at org.osate.ui.handlers.AbstractInstanceOrDeclarativeModelReadOnlyHandler.doAaxlAction(AbstractInstanceOrDeclarativeModelReadOnlyHandler.java:125)
	at org.osate.ui.handlers.AbstractAaxlHandler.processAaxlAction(AbstractAaxlHandler.java:482)
	at org.osate.ui.handlers.AbstractAaxlHandler.actionBody(AbstractAaxlHandler.java:191)
	at org.osate.ui.handlers.AaxlReadOnlyHandlerAsJob$ActionAsJob.runInWorkspace(AaxlReadOnlyHandlerAsJob.java:124)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Upon investigation the TransactionChangeRecorder's editing domain has a null transaction reference when assertWriting is called.

This doesn't seem to happen on any one's Windows machines, or on Joe's MacBook.

I found an old error report on the web that had the same error: https://bugs.eclipse.org/bugs/show_bug.cgi?id=371717

Basically this is a threading issue. There is some missing synchronization somewhere. This isn't an issue on the other computers, I think, because the threads are being managed differently. My computer is newer and has more cores and that is probably what is making the problem appear.

@lwrage
Copy link
Contributor

@lwrage lwrage commented Oct 8, 2019

I'm not sure why we even save the analysis result. As a workaround you can disable that.

@lwrage
Copy link
Contributor

@lwrage lwrage commented Oct 8, 2019

The analysis writes the analysis result to a file. For that it adds the result to the same resource set which contains the instance model. When run from the instance editor all modifications to the resource set require a transaction. This can be fixed by either not saving the analysis result (fast and easy) or by running the analysis as an EMF command (need to figure out how to do that).

@lwrage lwrage changed the title Flow Latency Analysis crashes on iMac Flow latency analysis crashes when run from instance model editor Oct 9, 2019
@lwrage lwrage self-assigned this Oct 9, 2019
@lwrage lwrage added this to the 2.6.0 milestone Oct 9, 2019
AaronGreenhouse added a commit that referenced this issue Oct 11, 2019
Run latency analysis as modify operation - fixes #2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants