Skip to content

Commit ed4a472

Browse files
committed
Fix network span parent-child relationship error #23777
**Phenomenon and reproduction steps** **Root cause and solution** **Impactions** **Test method** **Affected branch(es)** * main **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo)
1 parent e63b06e commit ed4a472

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/app/application/l7_flow_tracing.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ def add_flow(self, flow, network_delay_us):
840840
if self.resp_tcp_seq and flow["type"] != L7_FLOW_TYPE_REQUEST and (
841841
self.resp_tcp_seq != flow["resp_tcp_seq"]):
842842
return False
843+
all_empty = True
844+
# One has only req_tcp_seq, the other has only resp_tcp_seq
843845
for key in MERGE_KEYS:
844846
if flow["type"] == L7_FLOW_TYPE_RESPONSE or not self.req_tcp_seq:
845847
if key in MERGE_KEY_REQUEST:
@@ -849,6 +851,7 @@ def add_flow(self, flow, network_delay_us):
849851
continue
850852
if self.get(key) and flow.get(key) and (self.get(key) !=
851853
flow.get(key)):
854+
all_empty = False
852855
# http2 == grpc
853856
if key == 'l7_protocol' and self.get(key) in [
854857
21, 41
@@ -859,6 +862,11 @@ def add_flow(self, flow, network_delay_us):
859862
] and flow.get(key) in ['HTTP2', 'gRPC']:
860863
continue
861864
return False
865+
# merge key all empty
866+
if all_empty and self.req_tcp_seq != flow[
867+
"req_tcp_seq"] and self.resp_tcp_seq != flow[
868+
"resp_tcp_seq"]:
869+
return False
862870
if abs(self.start_time_us -
863871
flow["start_time_us"]) > network_delay_us or abs(
864872
self.end_time_us -

0 commit comments

Comments
 (0)