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

Re-draw pdbpp prompt on SIGINT #349

Merged
merged 8 commits into from
Jan 26, 2023
Merged

Re-draw pdbpp prompt on SIGINT #349

merged 8 commits into from
Jan 26, 2023

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Jan 26, 2023

Fixes a long running issue todo with ctl-c during pdbpp REPL use to ensure that the prompt is always redrawn after log msgs indicating that the SIGINT is being ignored in whatever actor currently owns the TTY lock / is running a REPL.

Also, this resolves the issues (AFAIK) that were preventing us from using the pypi version of pdbpp as mentioned in #323. So we should be able to do a working release again 😂 ?

Probably pertains to:

The stdlib has all sorts of muckery with ignoring SIGINT in the
`Pdb._cmdloop()` but here we just override all that since we don't trust
their decisions about cancellation handling whatsoever. Adds
a `Lock.repl: MultiActorPdb` attr which is set by any task which
acquires root TTY lock indicating (via actor global state) that the
current actor is using the debugger REPL and can be expected to re-draw
the prompt on SIGINT. Further we mask out log messages from any actor
who also has the `shield_sigint_handler()` enabled to avoid logging
noise when debugging.
@goodboy goodboy added bug Something isn't working cancellation SC teardown semantics and anti-zombie semantics debugger labels Jan 26, 2023
@goodboy goodboy requested a review from guilledk January 26, 2023 17:49
@goodboy goodboy changed the title Re-drawn pdbpp prompt on SIGINT Re-draw pdbpp prompt on SIGINT Jan 26, 2023
@goodboy
Copy link
Owner Author

goodboy commented Jan 26, 2023

Lol, so as was my hair ripping ayer, it turns out the behavior of this is quite different depending on the shell in use...

For example the tests are failing right now with bash (as i've verified it manually) with this:

screenshot-2023-01-26_13-57-40

and whereas my issue hacking on this yesterday was that xonsh has some kind of SIGINT handling bug where the examples/debugging/multi_daemon_subactor.py will hang on final root actor teardown if you do the ctlc path (manually) and quickly..

So I guess probably need to force bash when running the tests locally somehow as well as somehow hack this actual UX where we're seeing 2x Pdb++> prompts..

@goodboy goodboy merged commit de93c82 into master Jan 26, 2023
@goodboy goodboy deleted the prompt_on_ctrlc branch January 26, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cancellation SC teardown semantics and anti-zombie semantics debugger
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants