-
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
End the pdb
SIGINT handling madness
#170
Conversation
Turns out this is a lower level issue in terms of the stdlib's default `pdb.Pdb` settings and how they conflict with `trio`s cancellation and KBI handling. The details are hashed out more thoroughly in python-trio/trio#1155. Maybe we can get a fix in trio so things are solved under our feet :)
actor, main, host, port, arbiter_addr=arbiter_addr | ||
) | ||
finally: | ||
logger.info("Root actor terminated") |
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.
These are probably superfluous (and maybe should be .debug()
) but figured can't hurt atm. Likely we'll throttle back logging noise before first .dev0
.
self._listeners.extend(listeners) | ||
log.debug( | ||
"Started tcp server(s) on" | ||
f" {[getattr(l, 'socket', 'unknown socket') for l in l]}") |
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.
just mypy
stuff since technically .socket
isn't discovered through the type system easily.
@@ -132,19 +130,6 @@ async def _acquire_debug_lock(uid: Tuple[str, str]) -> AsyncIterator[None]: | |||
log.error(f"TTY lock released by {task_name}:{uid}") | |||
|
|||
|
|||
def handler(signum, frame): |
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.
Turns out we can just keep trio
standard KBI handling as long as we prevent pdb.Pdb
from overriding it!
# critical to having ctrl-c work in the ``trio`` standard way! | ||
# The stdlib's pdb supports entering the current sync frame | ||
# on a SIGINT, with ``trio`` we pretty much never want this | ||
# and we did we can handle it in the ``tractor`` task runtime. |
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.
should be and if we did..
Turns out this is a lower level issue in terms of the stdlib's default
pdb.Pdb
settings and how they conflict withtrio
s cancellation andKBI handling. The details are hashed out more thoroughly in
python-trio/trio#1155. Maybe we can get a fix in trio so things are
solved under our feet :)