-
Notifications
You must be signed in to change notification settings - Fork 27
Clear supplementory directories when xml analysis configuration is deleted #268
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
Clear supplementory directories when xml analysis configuration is deleted #268
Conversation
So that the corresponding state system and segement store is deleted when calling clearPersistentData(). [Fixed] Implement XmlPatternAnalysis.clearPersistentData() Fixes eclipse-tracecompass#267 Signed-off-by: Bernd Hufmann <[email protected]>
05493e5 to
3740873
Compare
| } | ||
| } | ||
| } catch (CoreException e) { | ||
| Activator.logError("Can't delete supplementary resources for XML anlayses", e); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
analyses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| } | ||
| if (resource instanceof IFile) { | ||
| analysisIds.forEach(analysisId -> { | ||
| if (resource.getName().startsWith(analysisId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a certainty that XML analysis will only create supplementary files that are prefixed with the analysisId? It does seem to be the case with those created by TmfAnalysisModuleHelperXml.
I'm worried if you could create two XML analysis where one has an id that is based on the other but with an extra suffix at the end, then deleting the base one could delete the files from the other?
I can't think of a non-scary alternative though, like waking up every trace in the workspace to make them clear their persistent data for that analysis! Or keeping track somewhere of every supplementary file that gets created for each XML analysis.
Perhaps forcing to clear persistent data when the XML module is disposed? But this would mean it needs to be recreated every time the trace is opened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions. I aligned this implementation to the way it's done in Eclipse Trace Compass UI. See here for the equivalent code
Line 648 in cc5d49e
| if (resource.getName().startsWith(id)) { |
The analysisIds are coming from the XML files (see line 751 above), so we'll only delete resources coming from analyses defined in the XML file. So, I think it's ok, no?
Please note, that I was not able to re-use the same code for the trace server because it's in UI and because the trace server doesn't have an equivalent project model implementation.
Fixes eclipse-tracecompass#267 [Fixed] Delete supplementary files when deleting xml analysis config Signed-off-by: Bernd Hufmann <[email protected]>
3740873 to
63a5706
Compare
What it does
fixes #267
How to test
The corresponding state systems or segment store files are deleted from the supplementary directories.
Follow-ups
None
Review checklist