Skip to content
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

task: fix spawn_local source location for console #5984

Merged
merged 1 commit into from
Sep 6, 2023

Commits on Sep 5, 2023

  1. task: fix spawn_local source location for console

    The location of a spawned task, as shown in tokio console, is taken from
    the location set on the tracing span that instruments the task. For this
    location to work, there must be unbroken chain of functions instrumented
    with `#[track_caller]`.
    
    For `task::spawn_local`, there was a break in this chain and so the
    span contained the location of an internal function in tokio.
    
    This change adds the missing `#[track_caller]` attribute. It has been
    tested locally as automated tests would really need `tracing-mock` to be
    published so we can use it in the tokio tests.
    hds committed Sep 5, 2023
    Configuration menu
    Copy the full SHA
    5de9bd5 View commit details
    Browse the repository at this point in the history