Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up#[instrument] codegen does not work with async_trait async fns #399
Labels
Comments
This comment has been minimized.
This comment has been minimized.
|
I'd be willing to help with this as it's an issue I've came up against. I may need some help though |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
async_trait(as re-exported bytonic) andinstrumentdo not work as expected together. Instrumented async trait fns enter then immediately exit and drop their span, while top-level async functions work as expected.Minimal reproduction with checked-in expanded macro-generated code at https://github.com/pkinsky/tracing-async-trait-bug-repro
This is a cross-project bug, let me know if it's best posted elsewhere.
Version
Platform
Crates
tracing-attributes, tracing-futures
Description
code output by
#[instrument]macro for async trait functions does not use expected code gen pathway for async trait fns.for
the resulting generated code uses the expected future instrumentation pathway for
top_levelbut for the async trait fn
fooit generates