mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 08:01:26 +00:00
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:
1 parent
7ce1f83fe5
commit
f809b04782
1 file changed
+7
-6
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user