Skip to content

Commit

Permalink
Print tokio task trace in s3_object_apply_fns.rs.
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed Oct 11, 2024
1 parent d601942 commit 849b314
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ envman_build_release = [

[env]
CLICOLOR_FORCE = "1"

[target.'cfg(not(target_arch = "wasm32"))']
rustflags = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,22 @@ where
})?;
base64::engine::general_purpose::STANDARD.encode(bytes)
};
#[cfg(not(target_arch = "wasm32"))]
{
let handle = tokio::runtime::Handle::current();
if let Ok(dump) = tokio::time::timeout(
tokio::time::Duration::from_secs(2),
handle.dump(),
)
.await
{
for (i, task) in dump.tasks().iter().enumerate() {
let trace = task.trace();
eprintln!("==== Task {i}: ===");
eprintln!("{trace}\n");
}
}
}
let put_object_output = client
.put_object()
.bucket(bucket_name)
Expand Down

0 comments on commit 849b314

Please sign in to comment.