Skip to content

Commit

Permalink
test fix for out of order span requests
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Nov 21, 2023
1 parent 0a7cab1 commit a26aedd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion agent/workers/poller/inmemory_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ func (d *inmemoryDatastore) GetTraceByID(ctx context.Context, traceID string) (t
return traces.Trace{}, connection.ErrTraceNotFound
}

return traces.FromSpanList(spans), nil
trace := traces.FromSpanList(spans)

if !trace.RootSpan.ID.IsValid() {
// the trace has no root span yet, treat it as not found
return traces.Trace{}, connection.ErrTraceNotFound
}

return trace, nil
}

// GetTraceID implements tracedb.TraceDB.
Expand Down

0 comments on commit a26aedd

Please sign in to comment.