Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359695

Summary: Annotations Refactoring
Product: [Technology] Tigerstripe Reporter: Valentin Yerastov <valentin>
Component: AnnotationsAssignee: Project Inbox <tigerstripe.annotations-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nmehrega, skanton
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Annotations Refactoring Patch
none
Annotations Refactoring Patch 2
none
Deadlock after running a simple generator
none
Annotations Refactoring Patch 3
none
Patch 3 : Annotation resource processor fix
none
Annotations Refactoring Patch 4 none

Description Valentin Yerastov CLA 2011-10-03 08:06:08 EDT
Created attachment 204442 [details]
Annotations Refactoring Patch

There are the bugs in the annotation framework:

- ConcurrentModificationException when modifying annotations 
- Annotations of artifacts are not removed then we remove a project.
- DeferredResourceSaver must use WorkspaceJob 
- Annotation is not always saved in file 
- Annotation sometimes is not saved into project, instead of it is saved in metadata 
- Deadlocks then we work with annotations 

More information accessible in the internal JIRA.

I've fixed these bugs and I attached the patch for code-review.
Comment 1 Valentin Yerastov CLA 2011-10-04 14:39:08 EDT
Created attachment 204542 [details]
Annotations Refactoring Patch 2

I removed some debug log message and made some improvements. Please use the latest patch.
Comment 2 Navid Mehregani CLA 2011-10-05 11:57:48 EDT
First code review was done on Oct 5 2011 10:00am EST:

Main changes:
  - EMFDatabase has been replaced by Storage, which now uses TransactionalEditingDomains
  - AnnotationManager has been heavily modified: Registers a new resource change listener.  Initializes Storage
  - Following plugins are no longer needed: espace.core, espace.resource, espace.resources.monitor

Suggested modifications:
  - New public APIs have been added with no comments
  - All classes should be commented
  - EObjectRouter has been changed to Router, but there may be existing routers that already use EObjectRouter
  - Annotation example needs to be restored

Issues with testing patch:
  - On certain projects, a progress bar is spun off for a really long time.  Label of progress bar is 'Saving annotation file'
  - I came across a deadlock after running a simple generator, which prints out the annotation files.  I'll attach the full stack trace.
Comment 3 Navid Mehregani CLA 2011-10-05 11:58:33 EDT
Created attachment 204608 [details]
Deadlock after running a simple generator

Pay particular attention to Daemon Thread [ModalContext]
Comment 4 Valentin Yerastov CLA 2011-10-05 17:15:19 EDT
Created attachment 204640 [details]
Annotations Refactoring Patch 3

I fixed the suggested issues. Thanks for threads dump.
Comment 5 Navid Mehregani CLA 2011-10-06 10:49:46 EDT
Valentin, even with your updated patch, I still get the long-running progress bar "Save Annotation File", which runs for a really long time after adding an annotation to our implementation model.
Comment 6 Anton Salnik CLA 2011-10-07 09:53:44 EDT
Created attachment 204751 [details]
Patch 3 : Annotation resource processor fix

Please use "Annotation resource processor fix" over patch 3 to prevent long running save operation.
Comment 7 Navid Mehregani CLA 2011-10-07 20:22:23 EDT
Anton, I'm still able to reproduce this problem.  I'll give more details in the internal JIRA on which project to use.
Comment 8 Anton Salnik CLA 2011-10-13 00:30:37 EDT
Created attachment 205079 [details]
Annotations Refactoring Patch 4

Performance issues fixed. New extension point "annotationFiles" added to configure annotation files filtering.
Comment 9 Navid Mehregani CLA 2011-10-14 16:26:15 EDT
There are cases where a build job is triggered right after adding an annotation, the progress bar stays at 0% and takes a really long time for it to go away.  I'll post more details in the JIRA.
Comment 10 Navid Mehregani CLA 2011-10-14 16:52:33 EDT
The issue noted in comment#9 only happens once.  It seems to be ok after that.  Please go ahead and submit this patch.  Thanks!
Comment 11 Anton Salnik CLA 2011-10-21 00:16:46 EDT
Annotations patch 4 applied.