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

Can't interrupt on Windows #452

Closed
fonsp opened this issue Sep 18, 2020 · 11 comments · Fixed by #2659
Closed

Can't interrupt on Windows #452

fonsp opened this issue Sep 18, 2020 · 11 comments · Fixed by #2659
Labels
backend Concerning the julia server and runtime wide audience This affects a wide audience of Pluto users and future Pluto users

Comments

@fonsp
Copy link
Owner

fonsp commented Sep 18, 2020

This is because Distributed.interrupt always kills the process on Windows. I don't know why, I have spent some days on this interrupt stuff but it is beyond me. Maybe someone with experience in process signals can have a look?

Another solution is to not use Distributed anymore, #300

@fonsp fonsp added the backend Concerning the julia server and runtime label Sep 18, 2020
@fonsp fonsp added this to the 🛶 v0.13 milestone Sep 18, 2020
@fonsp
Copy link
Owner Author

fonsp commented Oct 20, 2020

I talked with @pfitzseb and he pointed out that only supporting the "soft interrupt", i.e.

schedule(running_task, InterruptException(); error=true)

is already quite nice! And relatively easy to implement

@pfitzseb
Copy link

FWIW, Windows doesn't have the same notion of signals as Unix, so you literally cannot send a SIGINT to a process. People usually default to killing the process outright, which probably is what you're seeing here.

@fonsp
Copy link
Owner Author

fonsp commented Oct 20, 2020

But the REPL can do it! It seems so close, yet so far 😪

@pfitzseb
Copy link

That's the same process though. But then again, I don't really understand how all of this works either ;)

@fonsp fonsp removed this from the 🛶 v0.13 milestone Jan 26, 2021
@fonsp
Copy link
Owner Author

fonsp commented Feb 19, 2021

#932

@FeldrinH
Copy link

Is there any hope of resolving this? When working with long-running code on windows this is extremely frustrating.

@el-oso
Copy link

el-oso commented Sep 16, 2022

Can we make a workaround? Like disabling the cell such that when I reload the cell is not executed?

@ron-wolf
Copy link

Hey @fonsp! Hope this message finds you well. I just ran into this same problem (for similar reasons to #1568), came upon this issue as a result, and figured I might be able to help produce a fix.

It seems to me that, when you opened the issue, you had spent a decent amount of effort seeking the root cause. If any of that research has stuck with you, can you please share some of your findings?

@pfitzseb
Copy link

This needs (something like) JuliaLang/julia#49541.

@fonsp
Copy link
Owner Author

fonsp commented Sep 27, 2023

We almost fixed it! See JuliaPluto/Malt.jl#60

JuliaLang/julia#49541 will be useful for handling interrupts more cleanly, eg the Ctrl+C signal to shut down Pluto, and we can make sure that interrupting the notebook will never interrupt Pluto/Malt internals. But the interrupt-on-windows issue is separate :)

@fonsp
Copy link
Owner Author

fonsp commented Sep 27, 2023

And @ron-wolf thanks so much for taking a look! This is really beyond my skillset and I feel crazy lucky that JuliaPluto/Malt.jl#60 worked 😅

I would love to get your review on JuliaPluto/Malt.jl#60! Finishing JuliaLang/julia#49541 would also be useful for Pluto (including experimentation on how to best use the new API inside Pluto and Malt).


Another topic is the "hard interrupt" that you get by pressing Ctrl+C 5 times within one second. Pluto does this automatically when the first interrupt did not work, but it is a bit unstable. (Hence we are scared to add tests for it.) The main issue is that it sometimes keeps going for too long which kills the process, because we don't have a good way to check if the interrupt worked.

Code is here: https://github.com/fonsp/Pluto.jl/blob/v0.19.28/src/evaluation/WorkspaceManager.jl#L656-L690

I want to move this code from Pluto to Malt.interrupt_auto(worker), and get a more rigorous implementation and testing on the Malt side. I started this in JuliaPluto/Malt.jl#60 but removed it again in a later commit.

Any help here would be super appreciated!

@fonsp fonsp added the wide audience This affects a wide audience of Pluto users and future Pluto users label Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime wide audience This affects a wide audience of Pluto users and future Pluto users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants