trio icon indicating copy to clipboard operation
trio copied to clipboard

Debugging / introspection features

Open njsmith opened this issue 8 years ago • 3 comments

For quality of life:

  • [x] A method on Task to get a traceback
  • [ ] Ability to introspect set of all tasks (compare to thread iteration APIs)
  • [ ] Give a task, quickly summarize what it's going. Curio has its "status" field. I don't like the manual bookkeeping this requires, and I think we can do better. Idea: walk the task's stack to find the innermost frame with a __trio_wchan__ local (or whatever), and report it as the wchan-equivalent. It could even be callable to get more details (e.g. run_in_worker_thread could set it to print the repr of the call being run). Or I guess we'd get something similar by just showing the name+arguments of the frame.
  • [ ] An async REPL that provides little utilities based on things like the above to see what's going on in your program.

njsmith avatar Jan 22 '17 13:01 njsmith

  1. Task#iter_await_frames
  2. not done yet
  3. not done yet, also https://github.com/python-trio/trio/issues/3079
  4. there's an async REPL but once 3.14 is out we can add remote execution (via sys.remote_exec) and that should satisfy this

A5rocks avatar May 21 '25 14:05 A5rocks

Will there be something similar to the new asyncio pstree?

Sxderp avatar May 23 '25 16:05 Sxderp

That's https://github.com/python-trio/trio/issues/413 and IMO it shouldn't be in trio itself (ie not included in the thing I mentioned in 4). But it's on the list of things I want to do!

A5rocks avatar May 23 '25 17:05 A5rocks