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

Feature: Ctrl-c should kill the pending IO and not the full kernel #75

Closed
tinmarino opened this issue Mar 8, 2020 · 4 comments
Closed

Comments

@tinmarino
Copy link
Contributor

On a Slow IO, pressing cltr-c should be handled and interupt the IO but not the full kernel.
The roadmap is to copy IPython implementation:

  • IRaku (kill kernel)
Welcome to Perl 6 (rakudo 2018.12).                                                                                                                                                    
In [1]: sleep 10                                                                                                                                                                       
              <Press Ctrl-C>                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                                      
In [1]: /home2/tourneboeuf/.local/lib/python3.7/site-packages/jupyter_console/ptshell.py:713: UserWarning: The kernel did not respond to an is_complete_request. Setting `use_kernel_is
_complete` to False.
  warn('The kernel did not respond to an is_complete_request. '
  • Ipython (kernel survive)
In [3]: sleep(10)     
^C---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-3-9fd31db589b3> in <module>
----> 1 sleep(10)

KeyboardInterrupt: 

In [4]: 13            
Out[4]: 13

@tinmarino
Copy link
Contributor Author

tinmarino commented Mar 19, 2020

  • I asked a question on stackoverflow. Answer : no way to kill a thread (Bduggan told me a week earlier but I like to double check).

  • It is overkill to fork for each user request (<Enter>) I guess.

  • Python is treating the SIGINT as KeyboardInterrupt exception that the main thread sends to a registered thread. On Linux, the main thread is receiving this signal so it is clean.

Long Journey => Be sure to -Ofun (jnthn)

  1. Some longjmp are present in the MoarVm (Dig deeper is the language stack)
  2. The try catch is THE solution. The exception must come from a side channel (see how other kernel handle the situation)

Hard Challenge => If you keep on until success, you will succeed before you stop

@bduggan
Copy link
Owner

bduggan commented Mar 19, 2020

I see the same behavior that you do. To me it's strange that ctrl-c in the console client even sends a SIGINT to the kernel; it seems like this should behave the same way that clicking 'interrupt' in the web client would (send a shutdown request to the kernel). I would be okay with just treating ctrl-c as a shutdown+restart request. It's not ideal, but it's better than the current behavior. Also as Jonathan pointed out there's no good way to deal with typing ctrl-c when the console code is starting threads other than hooking into the scheduler...and since this is raku, what if the console code is modifying $*SCHEDULER :-)

@tinmarino
Copy link
Contributor Author

It is too hard, plus the same issue appears in rakudo REPL.
So ... I admit I .... abandon !

@bduggan
Copy link
Owner

bduggan commented Apr 5, 2020

I opened #84 which makes the experience a little better -- I think it's a reasonable solution -- and I haven't seen any negative effects of doing the eval on another thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants