TUN-6867: Clear spans right after they are serialized to avoid returning duplicate spans

This commit is contained in:
cthuang
2022-10-18 12:15:51 +01:00
committed by Chung-Ting
parent b1de2a74fa
commit c3c050aa79
3 changed files with 12 additions and 21 deletions

View File

@@ -176,8 +176,6 @@ func (pr *packetResponder) exportSpan() {
}
spans := pr.tracedCtx.GetProtoSpans()
if len(spans) > 0 {
// Make sure spans are cleared after they are sent
defer pr.tracedCtx.ClearSpans()
pr.datagramMuxer.SendPacket(&quicpogs.TracingSpanPacket{
Spans: spans,
TracingIdentity: pr.serializedIdentity,