Skip to content

Conversation

@bhufmann
Copy link
Contributor

@bhufmann bhufmann commented May 21, 2025

What it does

  • Implement XmlPatternAnalysis.clearPersistentData(), so that the corresponding state system and segment store is deleted when calling clearPersistentData() on the analysis module.
  • Delete supplementary files when deleting xml analysis configuration
  • Add unit tests

fixes #267

How to test

  1. Load XML analysis file using python client (loadConfiguration()). Use a pattern analysis
  2. Open trace and xml analysis view
  3. Delete XML analysis file using python client (deleteConfiguration())

The corresponding state systems or segment store files are deleted from the supplementary directories.

Follow-ups

None

Review checklist

  • As an author, I have thoroughly tested my changes and carefully followed the instructions in this template

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]>
@bhufmann bhufmann force-pushed the clear-suppl-directories branch 4 times, most recently from 05493e5 to 3740873 Compare May 21, 2025 23:08
}
}
} catch (CoreException e) {
Activator.logError("Can't delete supplementary resources for XML anlayses", e); //$NON-NLS-1$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analyses

Copy link
Contributor Author

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)) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

.

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]>
@bhufmann bhufmann force-pushed the clear-suppl-directories branch from 3740873 to 63a5706 Compare May 26, 2025 15:05
@bhufmann bhufmann merged commit 1c6c571 into eclipse-tracecompass:master May 26, 2025
4 checks passed
@bhufmann bhufmann deleted the clear-suppl-directories branch May 26, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trace-server: Supplementary files not deleted when loading, updating or deleting XML analysis

2 participants