async-trait: cross-project bug: async_trait and tracing::instrument are incompatible
The combination of macros results in the instrument macro thinking the instrumented function is not in fact async and generating the wrong code.
see full writeup here, cross-posting b/c someone on the tonic/tracing/etc discord suggested it. Thanks for providing this crate!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (9 by maintainers)
Thanks for the explanation and links!
I’d be fine having a small tracing::Subscriber impl dedicated to this one test. For an async trait method containing one event, all we care about in this crate is that the event happens before the exit (as opposed to before @nightmared’s fix, where the exit would happen as soon as the BoxFuture was created). A struct with a Cell<bool>, or even a static with an AtomicBool, would be enough for our purposes.