Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 497379 - Validation deadlocks when proxy resolution loads other resources
Summary: Validation deadlocks when proxy resolution loads other resources
Status: VERIFIED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X
: P1 critical (vote)
Target Milestone: 3.0.0   Edit
Assignee: Christian Damus CLA
QA Contact: Peter Cigehn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-06 08:20 EDT by Christian Damus CLA
Modified: 2017-05-10 04:16 EDT (History)
3 users (show)

See Also:
give.a.damus: neon+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2016-07-06 08:20:59 EDT
Now that bug 497342 is fixed and the control-mode resource load listener actually runs to poke the sash model in an unprotected transaction, model validation will deadlock if it ever causes a sub-unit resource or another cross-referenced model to load.

The problem is simply that the the AbstractValidateCommand, running in a transaction on the main thread, forks the validation operation onto the Model Context Thread without handing off its transaction to the that other thread.  Consequently, any listener reacting to resource load notifications that attempts to open even a read-only transaction or an unprotected write transaction will deadlock the UI.

Steps to reproduce:

1.  Open a model that has cross-references to some other model (for example,
    ModelA attached to bug 458837, imported from RSA.
2.  Validate the model.
3.  See the progress dialog hang.
Comment 1 Christian Damus CLA 2016-07-06 08:21:38 EDT
I have a fix in hand.
Comment 2 Eclipse Genie CLA 2016-07-06 08:24:33 EDT
New Gerrit change created: https://git.eclipse.org/r/76698
Comment 3 Eclipse Genie CLA 2016-07-06 08:25:55 EDT
New Gerrit change created: https://git.eclipse.org/r/76699
Comment 4 Eclipse Genie CLA 2016-07-06 09:05:18 EDT
Gerrit change https://git.eclipse.org/r/76698 was merged to [streams/2.0-maintenance].
Commit: http://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=01e4e159c54433189d8a8b1a899c0711642bf311
Comment 6 Christian Damus CLA 2016-07-06 09:44:56 EDT
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/76698 was merged to
> [streams/2.0-maintenance].

(In reply to Eclipse Genie from comment #5)
> Gerrit change https://git.eclipse.org/r/76699 was merged to [master].
Comment 7 Peter Cigehn CLA 2016-07-06 10:33:16 EDT
Verified in the context of Papyrus-RT (with Gerrit changes to shard-prototype applied) with the latest Neon Papyrus build, that the dead-lock no longer occurs when validating a model with cross-references to another model.