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

Incorrect engine setup results in duplicate deletion errors #26

Open
ujhelyiz opened this issue Mar 1, 2019 · 5 comments
Open

Incorrect engine setup results in duplicate deletion errors #26

ujhelyiz opened this issue Mar 1, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ujhelyiz
Copy link
Member

ujhelyiz commented Mar 1, 2019

Recently I have seen a lot of Duplicate deletion errors coming from VIATRA Base when working with MagicDraw models.

It seems that is caused by an incorrect engine setup: in https://github.com/viatra/v4md/blob/master/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/ViatraQueryAdapter.java#L57 all models of a projects are collected and then added to the base index as model roots.

Such a code is required as external models from TWS/TWC are not contained in the original project root; however it is problematic as e.g. in case of local projects referenced models are contained.

We should update the engine setup to handle such cases correctly.

@ujhelyiz ujhelyiz added the bug Something isn't working label Mar 1, 2019
@ujhelyiz ujhelyiz self-assigned this Mar 1, 2019
ujhelyiz added a commit that referenced this issue Mar 1, 2019
This avoids _some_ duplicate addition/deletion events, but there are
still more issues that need further debugging to avoid.
ujhelyiz added a commit that referenced this issue Mar 5, 2019
Experiments to fix inconsistent project setup issues
@lunkpeter lunkpeter reopened this Jul 10, 2019
@istvanrath
Copy link

2019-08-02 08:22:06,034 [AWT-EventQueue-0] INFO  GENERAL - Close Project task started.
2019-08-02 08:22:45,631 [pool-MagicDraw-thread-103:Close Project] ERROR org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil.org.eclipse.viatra.query.runtime.api.ViatraQueryEngine.1814111210 - Error: trying to remove duplicate value  from the unique feature org.eclipse.emf.ecore.impl.EAttributeImpl@69228e85 (name: name) (ordered: false, unique: true, lowerBound: 0, upperBound: 1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: , unsettable: false, derived: false) (iD: false) of host object com.nomagic.uml2.ext.magicdraw.actions.mdbasicactions.impl.InputPinImpl@18338dd2. This indicates some errors in underlying model representation.
2019-08-02 08:22:45,633 [pool-MagicDraw-thread-103:Close Project] ERROR org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil.org.eclipse.viatra.query.runtime.api.ViatraQueryEngine.1814111210 - Error: trying to remove duplicate value public from the unique feature org.eclipse.emf.ecore.impl.EAttributeImpl@524a2ffb (name: visibility) (ordered: false, unique: true, lowerBound: 0, upperBound: 1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (iD: false) of host object com.nomagic.uml2.ext.magicdraw.actions.mdbasicactions.impl.InputPinImpl@18338dd2. This indicates some errors in underlying model representation.
2019-08-02 08:22:45,633 [pool-MagicDraw-thread-103:Close Project] ERROR org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil.org.eclipse.viatra.query.runtime.api.ViatraQueryEngine.1814111210 - Error: trying to remove duplicate value com.nomagic.uml2.ext.magicdraw.classes.mdkernel.impl.ClassImpl@fa62cedd from the unique feature org.eclipse.emf.ecore.impl.EReferenceImpl@3e104d4b (name: type) (ordered: false, unique: true, lowerBound: 0, upperBound: 1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (containment: false, resolveProxies: true) of host object com.nomagic.uml2.ext.magicdraw.actions.mdbasicactions.impl.InputPinImpl@18338dd2. This indicates some errors in underlying model representation.

@istvanrath
Copy link

It seems maybe the base index should be deattached before project closure?

@lunkpeter
Copy link
Contributor

It not only appears when the project closes. Removing containment hierarchies can have the same effect.

@ujhelyiz
Copy link
Member Author

ujhelyiz commented Aug 5, 2019

Commit a0fa9cf adds a test case where we could demonstrate the duplicate EMF notifications using a single model delete (without relying on VIATRA).

We have discussed with @istvanrath in person that we should try to make this error message more user-friendly (e.g. do not include all details unless log level is set to info/debug or maybe reduce the default severity to warning in V4MD); we should think about it.

ujhelyiz added a commit that referenced this issue Aug 10, 2019
In addition to the suppression, the minimal test case for duplicate
detection was retrofitted to check that log levels.
ujhelyiz added a commit that referenced this issue Aug 14, 2019
Suppresses notification logging #26
@ujhelyiz
Copy link
Member Author

A quick solution was merged of notification suppressing - to have a cleaner solution we have to provide an API in VIATRA for it that takes longer time to implement. The API request is tracked by bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=549955

ujhelyiz added a commit that referenced this issue Aug 16, 2019
This reverts commit 1d9b398 because the
Base index internals cannot be overridden appropriately.
ujhelyiz added a commit that referenced this issue Aug 23, 2019
This change rewrites MagicDrawProjectNavigationHelper to rely on the
latest VIATRA features to cleanly suppress duplicate notification
errors.

Note: to test out the changes, we have to deploy a SNAPSHOT build to Nexus; this build temporarily relies on VIATRA v2.3.0-SNAPSHOT instead of 2.2.0/2.2.1; before this is fixed we should not create any release for V4MD.
ujhelyiz added a commit that referenced this issue Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants