-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wen? Multiprocessing-native debugger now! #129
Conversation
@guilledk If you get a chance try to play with this as well :) |
Alright, so after much frustration trying to get tab completion to just work I went back to Of course I think instead of doing a big writeup here I'm going to make a new issue and discuss my findings. Oh and one further approach we may want to take to get the fancy stuff for now is just don't hook up subproc stdin to a pipe and instead let it have the parent's tty and then just use a |
cf8a980
to
dddbeb0
Compare
This comment has been minimized.
This comment has been minimized.
@guilledk yeah, I'm not following that change? The debugging stuff I don't think should have an effect here? |
df5e702
to
5a27065
Compare
5a1a245
to
1b6ee2e
Compare
Worth mentioning is that I have not idea if this stuff works no windows since there doesn't seem to be any Might have to dig into this so that likely means a deferral issue is coming. |
bcb2714
to
8b4e2bb
Compare
8b4e2bb
to
0177268
Compare
bf90705
to
0510ab2
Compare
0510ab2
to
bba47e4
Compare
portal = await tn.run_in_actor('sleeper', spin_for) | ||
|
||
|
||
@no_windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need an issue for this as well.
@@ -171,13 +176,16 @@ class Actor: | |||
_root_n: Optional[trio.Nursery] = None | |||
_service_n: Optional[trio.Nursery] = None | |||
_server_n: Optional[trio.Nursery] = None | |||
_lifetime_stack: ExitStack = ExitStack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, we might want tests for this 🤣..
Maybe it's ok to just slip it in for now and worry later?
|
||
|
||
# TODO: | ||
# - recurrent entry to breakpoint() from single actor *after* and an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think most of these are covered now but wouldn't hurt to do an audit in the future.
I don't have much juice left to keep pushing here 😿
tests/test_debugger.py
Outdated
at each level up the tree. | ||
""" | ||
|
||
# TODO: inside this script there's still a bug where if the parent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually fixed now and is addressed by solving #156.
The test below actually demonstrates this is now solved.
This is a first attempt at accomplishing #113 😮
Surprisingly it all works without using any threads,
greenback
, or other dark magic; it's justtractor
bby 💋.Hopefully we can get some feedback from lurkers 🕵️
This first edition definitely works as well as other alternatives but there's a bunch of stuff we can do to make it better.
Caveats:
only first level actors can be debugged this way since the parent requires access to the subprocesse's stdin pipe2nd depth level actors are completely untested for nowImmediate TODOs:
pdbpp
🎉pytest
does it is probably a good start.debug_mode
is cool or not..dev0
usage so marking complete for now.For the future:
Channel
. There seems to be a variety of projects that do this mostly listed in REPL-driven, multi-process-native debugger features #113. I want to usepdb++
since I think it's the best UX available, but we may need to hook into itssys.stdin
in a sneaky way.epdb
seems to have code for this (on regularpdb
) but I haven't tested it.breakpoint()
built-in (I also have the draft code commented in here)await breakpoint()
unless we implement it a different way