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

tracing can't track the execution duration of futures passed to futures-concurrency #137

Open
9 of 12 tasks
yoshuawuyts opened this issue Jun 11, 2023 · 0 comments
Open
9 of 12 tasks
Labels
bug Something isn't working

Comments

@yoshuawuyts
Copy link
Owner

yoshuawuyts commented Jun 11, 2023

An example provided by @jstarks:

let fut1 = async { ... }.instrument(info_span!("span1"));
let fut2 = async { ... }.instrument(info_span!("span2"));
(fut1, fut2).join();

The problem is that both spans are always measured to have the same duration, because the wrapping future returned by .instrument keeps the span alive until the future is dropped, not until the future's poll() returns ready.

On our end the change we can make is to more eagerly drop futures on completion, rather than only dropping them when the final future resolves. Conservatively tagging this as a bug, since the resulting behavior is not right - even if we aren't failing to uphold any of Rust's async invariants.

tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant