hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Cannot interrupt/kill kernel without force quitting Atom

Open dharamsk opened this issue 6 years ago • 16 comments

Description:

Kernel cannot be killed without force quitting Atom.

Steps to Reproduce:

  1. Run an infinite while loop in an unsaved .py file
  2. Try to interrupt the process. Window is frozen. Kick self for not saving work prior to running.

Versions:

OSX 10.11.6 Atom 1.22.1 Hydrogen 2.1.0

Logs:

none

dharamsk avatar Nov 22 '17 03:11 dharamsk

Does it work in a saved file? If it does it's probably related to #1064

What command did you use to interrupt the kernel?

lgeiger avatar Nov 22 '17 10:11 lgeiger

The file was saved with one line in it and the kernel had been instantiated prior to that one line save.

I attempted to click on the bottom left of the window where is says "Python 2: Busy". The entire window was unresponsive. I could open a new window and use that, but the original window was unsalvageable (I waited a long time to see if it would respond before killing it).

dharamsk avatar Nov 22 '17 11:11 dharamsk

Did you have any print statements inside the loop?

I know that if you print output fast enough, Atom will hang because it can't keep up with displaying the messages. I've never seen it happen with just computations in the loop, though.

nikitakit avatar Nov 29 '17 00:11 nikitakit

no, it was supposed to continue the loop until a variable was defined. Like this:

some_var = None
while not some_var:
    i -= 1
    if i == 100:
         some_var = 'some string'

It wasn't exactly that, but similar in that it was fast iteration and would never succeed

dharamsk avatar Nov 29 '17 19:11 dharamsk

SOLVED

~~any updates on this? here's my little example:~~ screen shot 2018-04-06 at 15 32 10

DannyDannyDanny avatar Apr 06 '18 13:04 DannyDannyDanny

@DannyDannyDanny Your example could be resolved by interupting the kernel. Try opening up your command palette and searching for "Hydrogen: Interupt Kernel"

If you moved the print statement into the while loop there might be a problem because you've asked atom to render infinitely and other commands etc can become non-responsive.

BenRussert avatar Apr 07 '18 18:04 BenRussert

I think the issue is that while the kernel is busy processing the infinite loop, the entire window in atom freezes. You can't cmd-shift-p or anything like that. The only solution is to completely kill the program and hopefully you saved your work 😬

dharamsk avatar Apr 08 '18 00:04 dharamsk

I can take a video of this if you can't repro

dharamsk avatar Apr 08 '18 00:04 dharamsk

You should see Python3|busy in the bottom of the IDE. Click there and force the interruption. It should switch in Python3|idle status

rpalloni avatar Mar 28 '19 13:03 rpalloni

You should see Python3|busy in the bottom of the IDE. Click there and force the interruption. It should switch in Python3|idle status

Interrupt is not supported in windows, but you can restart the kernel.

NathanHodges avatar Apr 07 '19 23:04 NathanHodges

Will interrupt be supported for Windows eventually?

skim2257 avatar Jun 28 '19 14:06 skim2257

@skim2257 please see #597

wadethestealth avatar Jun 28 '19 15:06 wadethestealth

Same thing happened while I was running a python code. You'll see a option under Packages, script, You can stop a running script from there.

SohailIftikhar1234 avatar Jan 09 '20 19:01 SohailIftikhar1234

Yes that definitely helps thanks

Same thing happened while I was running a python code. You'll see a option under Packages, script, You can stop a running script from there.

MohnishMagesh avatar May 06 '20 03:05 MohnishMagesh

There is one way to get out of kernel in a case of infinite loop - Ctrl+Tab. Worked for me. Do let me know if it works for you!

SparkyPenguin avatar Jun 16 '21 13:06 SparkyPenguin

Screenshot 2022-09-07 at 1 32 46 PM

kshwedha avatar Sep 07 '22 08:09 kshwedha