Skip to content

Commit

Permalink
opentracing: Add span to root if parent not found
Browse files Browse the repository at this point in the history
If the quark for a parent span ID does not exist, add the span at the
child span at the root of the trace's span instead of returning.

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Change-Id: Ia290e2d33f08499db65965d484e0f02a2bdc12e8
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/172157
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
tahini committed Nov 16, 2020
1 parent 624bef8 commit 922b54b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private void handleSpan(ITmfEvent event, ITmfStateSystemBuilder ss) {
} else {
Integer parentQuark = fSpanMap.get(refId);
if (parentQuark == null) {
return;
// We don't have the parent span, just start this span at root
parentQuark = openTracingSpansQuark;
}
spanQuark = ss.getQuarkRelativeAndAdd(parentQuark, name + '/' + spanId + '/' + errorTag + '/' + processName);
}
Expand Down

0 comments on commit 922b54b

Please sign in to comment.