镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

hyper-util tracing behavior leads to very surprising behavior for client code #4053

Closed as duplicate

Description

@mattklein123

Version

hyper-util latest

Platform

all

Summary

See tokio-rs/tracing#3521 for full context.

The TL/DR is that https://github.com/hyperium/hyper-util/blob/8ae9e8b1e338a5b7d35155a0dc3708cfd94bcae2/src/rt/tokio.rs#L110-L112 leads to very difficult to debug behavior via the executor spawning a task inside the current span where that task may be very long lived (like a connection pool connection).

I'm happy to make changes here but I wanted to understand what the maintainers would like to do. IMHO the tracing feature is broken and shouldn't work like this. It seems bad to just spawn with the current Span onto a new task.

My initial take is to just remove the code/feature entirely until someone wants to improve it. Alternatively I think it has to be changed so that tracing is opt-in per request somehow.

Thoughts and guidance?

Code Sample

Expected Behavior

Don't capture the current Span onto a long lived background task.

Actual Behavior

Spans are captured onto a long lived background task.

Additional Context

No response

Activity

  1. added
    C-bugCategory: bug. Something is wrong. This is bad!
    on Apr 17, 2026
  2. seanmonstar commented on Apr 20, 2026

    @seanmonstar
    Member

    I've seen both sides argued. Personally, I lean more towards fixing this behavior than keeping the current behavior. But more is in #3904 (perhaps even this being a duplicate?).

  3. mattklein123 commented on Apr 21, 2026

    @mattklein123
    Author

    Yes it's a dup. Will defer to you if you want to close in favor of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug. Something is wrong. This is bad!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions