tmf: Fix deadlock in analysis module
authorPatrick Tasse <patrick.tasse@gmail.com>
Mon, 21 Apr 2014 14:21:13 +0000 (10:21 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Wed, 23 Apr 2014 21:07:32 +0000 (17:07 -0400)
Deadlock occurred when renaming a trace while its analyses are ongoing.

The refresh of supplementary folders is now done outside of the analysis
synchronization lock.

It is not necessary to trigger the refresh when cancel() is called,
since it will be triggered when the analysis execution is completed
(whether it was cancelled or not).

Change-Id: Id65fe9d57fadab1d17096d7e20bb15f43d30f1c7
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/25323
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/analysis/TmfAbstractAnalysisModule.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java

index 26c9f750f521bf1d967e40cc70514e45886c18b3..d8e4e97ee0ab9846ba6a7b1da6e1830ef2690ad9 100644 (file)
@@ -222,7 +222,6 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
         fStarted = false;
         fJob = null;
         fFinishedLatch.countDown();
-        TmfTraceManager.refreshSupplementaryFiles(fTrace);
     }
 
     /**
@@ -268,6 +267,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
             fStarted = true;
         }
 
+        final ITmfTrace trace = fTrace;
         /*
          * Actual analysis will be run on a separate thread
          */
@@ -285,6 +285,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
                         monitor.done();
                         setAnalysisCompleted();
                     }
+                    TmfTraceManager.refreshSupplementaryFiles(trace);
                 }
                 if (!fAnalysisCancelled) {
                     return Status.OK_STATUS;
index 23fcfbeb9be44f664af7dc45e115858911c5c6ab..4a617a2517ebfb4c2a714109443ee371ec13bcd5 100644 (file)
@@ -241,7 +241,7 @@ public final class TmfTraceManager {
      */
     public static void refreshSupplementaryFiles(ITmfTrace trace) {
         IResource resource = trace.getResource();
-        if (resource != null) {
+        if (resource != null && resource.exists()) {
             String supplFolderPath = getSupplementaryFileDir(trace);
             IProject project = resource.getProject();
             /* Remove the project's path from the supplementary path dir */
This page took 0.026917 seconds and 5 git commands to generate.