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

Root tty hangs #234

Merged
merged 8 commits into from
Sep 2, 2021
Merged

Root tty hangs #234

merged 8 commits into from
Sep 2, 2021

Conversation

goodboy
Copy link
Owner

@goodboy goodboy commented Sep 2, 2021

Debugger improvements to avoid even further tty clobbering edge cases and potential root actor hangs when the debug lock is acquired but the child completes or intends to release it but the root never is notified.

@goodboy goodboy added bug Something isn't working debugging labels Sep 2, 2021
@goodboy
Copy link
Owner Author

goodboy commented Sep 2, 2021

Need to squash / drop a few of these commits.

@goodboy goodboy requested a review from guilledk September 2, 2021 18:59
Base automatically changed from drop_stream_shielding to master September 2, 2021 20:18
We're not actually using this but it's for reference if we do end up
needing it.

The std lib's `pdb` internals override SIGINT handling whenever one
enters the debugger repl. Force a handler that kills the tree if SIGINT
is triggered from the root actor, otherwise ignore it since supervised
children should be managed already. This resolves an issue with guest
mode where `pdb` causes SIGINTs to be swallowed resulting in the host
loop never terminating the process tree.
Always try to release the root tty lock on broken connection errors.
@@ -298,8 +298,8 @@ async def _open_and_supervise_one_cancels_all_nursery(
f'child {_debug._global_actor_in_debug}\n'
'Waiting on tty lock to release..')

with trio.CancelScope(shield=True):
await debug_complete.wait()
# with trio.CancelScope(shield=True):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may end up wanting to keep this but right now it's causing too many hangs.

@@ -62,7 +62,7 @@ def _trio_main(
"""
# Disable sigint handling in children;
# we don't need it thanks to our cancellation machinery.
signal.signal(signal.SIGINT, signal.SIG_IGN)
# signal.signal(signal.SIGINT, signal.SIG_IGN)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well keep for reference.

@goodboy goodboy merged commit 87ce6c8 into master Sep 2, 2021
@goodboy goodboy deleted the root_tty_hangs branch September 2, 2021 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant