actix / actix/actix-web

Task locations not exposed for tokio-console

Aperta
#2,646 1 commento 6 reazioni 0 assegnatari Vedi su GitHub
A-web blocked-on-upstream C-improvement
Lingua principale
Rust
Stelle
24.8k
Fork
1.9k
Merge medio
23h 10m
PR unite (30g)
26

Descrizione

Actix tasks don't show their source location in tokio-console.

## Expected Behavior
I would expect to see the source location of each task in tokio console

## Current Behavior
Most of the source locations appear to be from inside tokio:

Screen Shot 2022-02-10 at 12 56 08 PM

## Possible Solution
It looks like this has been partially fixed in tokio: https://github.com/tokio-rs/tokio/pull/4483 but may need some additional work on the actix side as mentioned on reddit:

> Note that actix-rt's spawning functions will probably also need to add #[track_caller] attributes, or else you'll just end up with a bunch of locations within actix-rt, rather than in your code.
https://www.reddit.com/r/rust/comments/snt5fq/can_tokioconsole_profile_actixrt

## Steps to Reproduce (for bugs)
1. Add [Console Subscriber](https://crates.io/crates/console-subscriber) to an actix app
2. Launch [tokio-console](https://github.com/tokio-rs/console)

## Context
It is difficult to debug performance issues in async applications, such as actix-web. Most traditional profiling yields a nested async/future/tokio things but it's hard to discern where the actual bottlenecks are occurring. tokio-console is a useful tool to get better insights into async systems and it would be great if actix played nicely with it.

## Your Environment

- Rust Version: 1.57.0
- Actix Web Version: 4.0.0-rc.1

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.