fix(inbound): scope the tracing span guard in the TCP accept path

The entered span guard was held across the await of the connection
handler, so the span stayed entered on the thread while the task yielded
and unrelated tasks were attributed to it. The span variable was also
shadowed right after the guard was taken. Scope the guard to the debug
log and keep a single span.
This commit is contained in:
eric committed 2026-09-08 14:12:39 +08:00
1 parent 7ce1f83fe5
commit f809b04782
1 file changed
+7 -6
+7 -6
View File
@@ -187,12 +187,13 @@ async fn handle_inbound_tcp_stream(
..Default::default()
};
let span = sess.span();
let _g = span.enter();
let span = sess.span();
debug!(
"handle inbound tcp stream src={} local={}",
&source, &local_addr
);
{
let _g = span.enter();
debug!(
"handle inbound tcp stream src={} local={}",
&source, &local_addr
);
}
async move {
// Transforms the TCP stream into an inbound transport.
let transport = timeout(