How to handle thread-locking code? #858
Unanswered
BrandonConder
asked this question in
Questions about using Pluto
Replies: 1 comment
-
Hey @BrandonConder ! Eventually we will implement #259 to fix this, right now your options are:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I started with Pluto, I managed to lose my work on my first notebook while I was experimenting with multithreading†.
Is there a feature to open a notebook for editing without executing it?
I've since determined that you can (as far as I can tell) ruin any notebook by adding a cell with the code
while true; end
, making sure it's saved (which might require running and interrupting the cell?), and closing/shutting down the notebook.From then on, whenever I open such a notebook it locks up Pluto entirely. The web browser hangs up like it's trying to load a page, but nothing ever shows up. Even using
Ctrl+C
at the REPL does nothing.I've tried this with Julia 1.5.3x64 on Ubuntu , Windows 10, and Ubuntu under Windows Subsystem Linux 2 (WSL2) and the behavior is the same (with the exception that the Windows binary can't interrupt cells).
As a novice with Pluto, as far as I can tell this makes the notebook unusable. I'm not sure if it's possible to remove the offending cell without rewriting the hashes, so my only option was to rebuild the notebook using the text within the notebook file.
I've attached the simplest example here: myworstnightmare.zip
So, what's the recommended way to handle thread-locking code?
Are there ways to open notebooks for editing without executing? If so can it be made obvious for new users?
Is it possible (perhaps only if julia has more than one thread) to have the Pluto code run periodic interrupts on a notebook to ensure that at least the notebook page is served up and
Ctrl+C
can be serviced?† I did eventually figure out that in this specific case, it was possible to interrupt the cell and yield to the main process, but by then I already corrupted the notebook by trying to edit out the offending cell with a text editor. Also note that cells can't be interrupted from the Windows Julia binary.
Beta Was this translation helpful? Give feedback.
All reactions