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

Provide an equivalent of curio.monitor #413

Open
Nikratio opened this issue Jan 20, 2018 · 7 comments

Comments

@Nikratio
Copy link

commented Jan 20, 2018

curio.monitor allows to debug an async program while it's running. It is fantastic for debugging, and it would be great to have something like this for trio.

@njsmith

This comment has been minimized.

Copy link
Member

commented Jan 20, 2018

Yeah, it would! I'm surprised we don't have an issue open for this already.

For those who haven't seen it, there's some monitor examples here, and also check this out.

I do think we should use a slightly different architecture: in curio the monitor is a single piece of monolithic code that's built into the core library, has a hardcoded mechanism for connecting, and has a small fixed set of commands, which are implemented using internal, non-public APIs. It's an awesome and useful proof-of-concept/demo, and we should provide a similar experience, but I'd like to do it in a way that lets monitor implementations evolve independently from the core trio library.

A lot of the groundwork for this is already there: Trio provides lots of introspection APIs. (Probably there are some gaps, but we can sort that out as we go.) For example, here's a little experiment in printing nice task trees from a live program, and there are lots of other things you can do – show task tracebacks, visualizing execution traces, etc. So I think the next step here would be for someone -- could be anyone -- to start building something and see how it goes. The curio monitor implementation is not very big.

In the longer run I think it'd be really neat to have a monitor interface that's an IPython REPL + magic commands for stuff like introspecting the task tree. But that's going to take some non-trivial work in IPython and python-prompt-toolkit to make them async/trio friendly (CC @Carreau).

@Carreau

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2018

IIRC prompt_toolit is already quite async-await friendly. IPython less so, but I'd love to convert all internal IPython API to be sans IO or async await compatible.

@goodboy

This comment has been minimized.

Copy link
Member

commented Jan 22, 2018

I think it'd be really neat to have a monitor interface that's an IPython REPL + magic commands for stuff like introspecting the task tree.

👍 👍 👍 that's exactly how it should go :)

@touilleMan

This comment has been minimized.

Copy link
Member

commented Feb 7, 2018

So I think the next step here would be for someone -- could be anyone --

I seems this anyone is me 😄

@lithp

This comment has been minimized.

Copy link

commented May 6, 2019

Does the existence of https://github.com/python-trio/trio-monitor mean this issue can be closed?

@njsmith

This comment has been minimized.

Copy link
Member

commented May 7, 2019

That repo is pretty much empty right now, unfortunately.

@Tronic

This comment has been minimized.

Copy link

commented Aug 14, 2019

There are three older (somewhat dead) monitoring projects that I know of, and my concept test from earlier this week https://github.com/Tronic/trio-web-monitor in case anyone is interested.

What is needed is someone willing to maintain the project long term, and then perhaps take the best elements of each of the existing implementations (then it is already a lot better than curio monitor or any other Python debugger for that matter). I am willing to participate if someone else shows up to cooperate but I won't take sole responsibility over it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.