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

Fix state out of sync issue caused by race condition #2989

Merged
merged 13 commits into from
Aug 15, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Aug 11, 2024

Fix #2904 🌟 yay!!!

The problem was........

send_notebook_changes!(🙋; skip_send=true)

skip_send meant that the patch was not being sent 😑

skip_send?

skip_send was added in #2273, but right now it looks like that was a mistake. The comment says that it is needed to fix #1892, but #1892 is about bonds, and this change is in the :run_multiple_cells function that is not triggered during a bond run.

#1892?

The original fix from #1892 was also no longer working. I fixed this in a separate PR: #2992 :) But that's probably not related.

queued = true?

So why is this code here? This is from https://github.com/fonsp/Pluto.jl/pull/710/files#diff-d0b76cc753bebaa7bbde63848adae9617f1e69dd9cd9986b98b7a3c5e39fc02bR360-R372

When a cell is triggered with Shift+Enter, its state is set to queued = true immediately on the frontend. And this code does the same in the backend.

Solution

Instead of calling send_notebook_changes! with skip_send=true to go through the client state update logic, we now just update the client state dictionary directly.

Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="fix-running-forever-maybe")
julia> using Pluto

@fonsp fonsp linked an issue Aug 11, 2024 that may be closed by this pull request
@fonsp
Copy link
Owner Author

fonsp commented Aug 12, 2024

run_threaded does not make a difference, also with julia --threads=auto

@fonsp fonsp added frontend Concerning the HTML editor backend Concerning the julia server and runtime labels Aug 12, 2024
@fonsp fonsp marked this pull request as ready for review August 12, 2024 15:49
@fonsp
Copy link
Owner Author

fonsp commented Aug 13, 2024

TODO:
change big comment to not talk about 1891

@fonsp fonsp merged commit bd67344 into main Aug 15, 2024
16 checks passed
@fonsp fonsp deleted the fix-running-forever-maybe branch August 15, 2024 07:56
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 frontend Concerning the HTML editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cell running forever Infinite stalls on bonds when computer is very fast
1 participant