-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with spawn_blocking()
tasks
#127
Comments
Your span never finishes so it can never be sent. Try creating a spans inside the loop. |
Sorry I didn't make it clear, I'm actually doing a busy loop: #[tracing::instrument]
fn test() {
loop {
read();
}
}
#[tracing::instrument]
fn read() {
while ptr.read_volatile() == 0 {}
info!("some log")
} |
And when you try with I'll try to take a look when I have some time, just trying to rule out as much as possible beforehand. |
Just tried that, It seems the issue happens with |
use tracing::Instrument;
tokio::spawn(async {
// something
}.in_current_span())
#[allow(unused_mut)]
let mut block = ; // something
let span = tracing::span::Span::current();
tokio::task::spawn_blocking(move || {
let _enter = span.enter();
block()
}) |
djc
changed the title
Not working with
Not working with Aug 21, 2024
spwan_blocking
tasksspawn_blocking()
tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Version
Platform
Description
I tried this code:
I expected to see this happen:
RUST_LOG=trace
, there should be someh2
/tonic
logsBut none of them happens, it only output my application logs:
The text was updated successfully, but these errors were encountered: