-
Notifications
You must be signed in to change notification settings - Fork 732
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
tracing::instrument: "Reached the type-length limit while instantiating ..." #616
Comments
Perhaps related to rust-lang/rust#58952 |
Hmm, this does seem similar to rust-lang/rust#54540 (the issue that that one is believed to be a duplicate of) at a glance. I'm not sure if there is anything Can you reproduce this with earlier versions of |
Thanks for the explanation :)
Yes, this example reproduces back to tracing-attributes 0.1.1 (on rustc 1.41.1). As a result, I think it's reasonable to conclude that this is indeed due to rust-lang/rust#54540. |
As a temporary workaround, I suspect sticking a |
The fix for rust-lang/rust#75313 increases the size of some types generated by tracing::instrument. The fix is in recent nightlies, and it is also proposed for backport to beta. After the fix, we saw "reached the type-length limit" with spans that were 4 functions deep. But the test case in this ticket goes 5 functions deep before failure. For details, see rust-lang/rust#75313 (comment) and ZcashFoundation/zebra#923. |
In Quinn we similarly observe that rust-lang/rust#75443 has triggered the requirement to set a type-lengh limit in one of our crates for the first time (like zebra, we use tracing in that crate), tracked in quinn-rs/quinn#839. |
Note that, unlike the OP, quinn does not use the proc macros. The relevant code is: let results = future::join_all(peers.into_iter().map(|peer| async move {
let span = info_span!("peer", name = peer.name.as_str());
let result = run(&peer, keylog).instrument(span).await;
(peer, result)
})); Maybe |
Yup, the error still reproduces. diff --git a/Cargo.toml b/Cargo.toml
index c1d28011..44d4264b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,3 +6,8 @@ debug = true
[profile.release]
debug = true
+
+[patch."crates-io"]
+tracing = { git = "https://github.com/tokio-rs/tracing", rev = "0454d6b41204a5cf98094ae1bebf20f6d97cb60b" }
+tracing-subscriber = { git = "https://github.com/tokio-rs/tracing", rev = "0454d6b41204a5cf98094ae1bebf20f6d97cb60b" }
+tracing-futures = { git = "https://github.com/tokio-rs/tracing", rev = "0454d6b41204a5cf98094ae1bebf20f6d97cb60b" } |
Rust 1.46.0 gives us trouble with too large types. Go back to log crate until this is resolved. Related: algesten/hreq#11 tokio-rs/tracing#616
Bug Report
Version
Platform
Linux 4.19.0
Crates
tracing-attributes v 0.1.7
Description
Best-effort minimal example:
This causes:
tracing-attributes + tracing-futures seems to be inflating the type-length significantly?
The text was updated successfully, but these errors were encountered: