fix(logs): Avoid grouping logs for separate tasks (#6923)
* Removes span.enter() in async code * Restores `accept_span` and uses in_scope() instead of enter() * Update zebra-network/src/peer_set/initialize.rs
This commit is contained in:
parent
dde790e92a
commit
9f0e18282c
|
|
@ -607,6 +607,13 @@ where
|
||||||
let _guard = accept_span.enter();
|
let _guard = accept_span.enter();
|
||||||
|
|
||||||
debug!("got incoming connection");
|
debug!("got incoming connection");
|
||||||
|
|
||||||
|
// # Correctness
|
||||||
|
//
|
||||||
|
// Holding the drop guard returned by Span::enter across .await points will
|
||||||
|
// result in incorrect traces if it yields.
|
||||||
|
//
|
||||||
|
// This await is okay because the handshaker's `poll_ready` method always returns Ready.
|
||||||
handshaker.ready().await?;
|
handshaker.ready().await?;
|
||||||
// TODO: distinguish between proxied listeners and direct listeners
|
// TODO: distinguish between proxied listeners and direct listeners
|
||||||
let handshaker_span = info_span!("listen_handshaker", peer = ?connected_addr);
|
let handshaker_span = info_span!("listen_handshaker", peer = ?connected_addr);
|
||||||
|
|
@ -638,6 +645,9 @@ where
|
||||||
handshakes.push(Box::pin(handshake_task));
|
handshakes.push(Box::pin(handshake_task));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We need to drop the guard before yielding.
|
||||||
|
std::mem::drop(_guard);
|
||||||
|
|
||||||
// Rate-limit inbound connection handshakes.
|
// Rate-limit inbound connection handshakes.
|
||||||
// But sleep longer after a successful connection,
|
// But sleep longer after a successful connection,
|
||||||
// so we can clear out failed connections at a higher rate.
|
// so we can clear out failed connections at a higher rate.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue