hyper-util icon indicating copy to clipboard operation
hyper-util copied to clipboard

fix(rt): remove automatic span propagation from TokioExecutor

Open bts opened this issue 4 days ago • 0 comments

Hi there -- thanks so much for hyper!

Per https://github.com/hyperium/hyper/issues/3904, the tracing feature previously attached the current span to all futures spawned by TokioExecutor::execute. This caused application-level spans to incorrectly extend beyond their intended endpoints when background tasks (connection dispatchers, pool maintenance) outlived the original request.

It seems like clients requiring span propagation should probably instead instrument futures at their call sites of execute, or implement their own Executor<Fut> as needed per their context (e.g. attaching to some separate root span).

This change removes the incorrect span propagation, but keeps the tracing feature flag for backwards compatibility.

Thanks for your consideration!

bts avatar Jan 15 '26 16:01 bts