Skip to content

Commit 18f15ef

Browse files
aaanhbhufmann
authored andcommitted
fix: trace server does not notify the client when the state system is empty and the analysis is completed, resulting in infinite polling
Signed-off-by: Anh Hoang Nguyen <[email protected]>
1 parent 3389fa5 commit 18f15ef

File tree

1 file changed

+4
-0
lines changed
  • analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented

1 file changed

+4
-0
lines changed

analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/internal/analysis/profiling/core/instrumented/FlameChartDataProvider.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ public TmfModelResponse<TmfTreeModel<FlameChartEntryModel>> fetchTree(Map<String
345345
boolean complete = fcProvider.isComplete();
346346
CallStackSeries callstack = fcProvider.getCallStackSeries();
347347
if (callstack == null) {
348+
// Explicitly tell the client that the analysis is completed to prevent further polling
349+
if (complete) {
350+
return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), Collections.emptyList()), ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED);
351+
}
348352
return new TmfModelResponse<>(new TmfTreeModel<>(Collections.emptyList(), Collections.emptyList()), ITmfResponse.Status.RUNNING, CommonStatusMessage.RUNNING);
349353
}
350354
long start = getTrace().getStartTime().getValue();

0 commit comments

Comments
 (0)