diff --git a/Cargo.toml b/Cargo.toml index d13bf7e8..150f09c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,6 @@ full = [ "http1", "http2", "tokio", - "tracing", ] client = ["hyper/client", "tokio/net", "dep:tracing", "dep:futures-channel", "dep:tower-service"] @@ -92,7 +91,13 @@ http2 = ["hyper/http2"] tokio = ["dep:tokio", "tokio/rt", "tokio/time"] -tracing = ["dep:tracing"] +# Currently unused feature. This previously attached the current span to all futures executed by +# `TokioExecutor`, which would incorrectly extend application-level spans beyond their correct +# endpoints due to asynchronous background tasks running under those spans. This is documented in +# https://github.com/hyperium/hyper/issues/3904. Clients wishing to add spans to executed futures +# should manually attach them to the futures provided to `TokioExecutor::execute`, or create their +# own implementation of `Executor` to attach spans as required by their particular context. +tracing = [] # internal features used in CI __internal_happy_eyeballs_tests = [] diff --git a/src/rt/tokio.rs b/src/rt/tokio.rs index bd5fd50f..e6346229 100644 --- a/src/rt/tokio.rs +++ b/src/rt/tokio.rs @@ -61,9 +61,6 @@ use std::{ use hyper::rt::{Executor, Sleep, Timer}; use pin_project_lite::pin_project; -#[cfg(feature = "tracing")] -use tracing::instrument::Instrument; - pub use self::{with_hyper_io::WithHyperIo, with_tokio_io::WithTokioIo}; mod with_hyper_io; @@ -108,10 +105,6 @@ where Fut::Output: Send + 'static, { fn execute(&self, fut: Fut) { - #[cfg(feature = "tracing")] - tokio::spawn(fut.in_current_span()); - - #[cfg(not(feature = "tracing"))] tokio::spawn(fut); } }