JunoLab: Cannot Interrupt/Kill Julia Process Midway

Hello!

I posted about this on the Atom discussion page, but I was recommended to post it here as well.

I am currently using Atom version 1.33.1 on Windows 10 to execute Julia code through the JunoLab package, and I’m using version 1.0.2 of Julia. I have noticed recently that I am unable to interrupt the code I am running in Julia before it has finished executing all the way. I used to use the keyboard shortcut “Ctrl-Shift-C” to do this, but it seems to be unresponsive. I also tried using the “Interrupt Julia” button in the toolbar, but that doesn’t seem to work either.

This is happening for all the code I run, not just a particular program. Something as simple as a for loop that prints all the numbers from 1 to 1,000,000 to the console cannot be interrupted. If anyone has any insight as to why I’m having this problem, I would be very grateful.

Thank you.

1 Like

Did you deactivate the Enable Powershell Wrapper option in the julia-client settings? Having that enabled is required for interrupts to work in the editor.

That said, interrupts in Juno are somewhat brittle on all OSs, but Windows is the worst. I might have something in the next release that at least makes ^C in the REPL the same as in a normal Julia REPL (although that’s not that much better – you might still get random segfaults and stuff).

I’m not sure if you’re seeing this also with long programs that don’t print - but I’ve noticed that when I run programs that print a bunch to the console, the interrupt may work but the console keeps scrolling (not sure if there’s and output buffer or something?).

What if you do:

for i in 1:10  
    println(i)
    sleep(2)
end

I encountered a similar problem in Jupyter. Interrupting Julia doesn’t seem to have any affect. The output keeps on scrolling. But restarting Julia does work for me.

1 Like

I double-checked, and the option is enabled in the julia-client settings.

Today I tried using the interrupt on the for loop again, and this time it worked, although I’m not sure what changed. However, I’m still having trouble getting the interrupt to work when the code is using another module.

For example, I’m working with several colleagues on implementing our simulation. One of them writes a module with some functions that I need for my code. I import the module into my section of code and start the code running. The simulation gets stuck in a loop somewhere while it’s evaluating one of the functions in the module, so I need to interrupt it. But for some reason it won’t allow me to interrupt it.

Do you have any idea what could be causing this? Thanks again for your help.

Thanks for the suggestion. For some reason the for loop interruptions started working again today, although I don’t know why. I’m still having trouble getting the interruptions to work when the code is stuck in another module’s function. (See the previous reply if you’re interested.)

I’m also unable to interrupt (but can kill) julia when running in atom (v1.52.0). Using windows 10 Enterprise. I can’t seem to find the Enable Powershell Wrapper option in julia client settings either. I’ve searched in all of the fields too e.g UI, Remote, Terminal options. Any pointers?

I removed the wrapper in favour of a more robust solution a while back. You should still be able to interrupt code, but only if it yields at some point (so e.g. put a print statement or whatever in your loop every n-th iteration).

I have a print statement: I am running an optimization problem (estimating parameters) and print the parameter guess for each iteration. But going to Juno->Interrupt Julia has no effect.

Dunno what’s going on then. Do you have a MWE I could try?
Is

while true
    sleep(1)
    print('.')
end

interruptible for you?

That works fine (i.e interrupts with no problems). I’ll try and figure out a MWE and get back to you.