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

Old @use_async still running #10

Open
fonsp opened this issue Mar 14, 2022 · 4 comments
Open

Old @use_async still running #10

fonsp opened this issue Mar 14, 2022 · 4 comments
Labels
enhancement New feature or request upstream Requires fix in Pluto.jl

Comments

@fonsp
Copy link
Member

fonsp commented Mar 14, 2022

I had a weird time debugging something today, until I found out that an old @use_async was still running. In this case I just commented out the entire callback, but the old callback was still running async.

Schermopname.2022-03-14.om.15.11.54.mov
@fonsp
Copy link
Member Author

fonsp commented Mar 14, 2022

The infinite loop is caused by a second cell that does something like:

let
	dir_changed_time

	write(joinpath(dir, "_cache", "hello.txt"), "world")
end

Which I was trying to avoid by filtering inside my filewatching callback

@fonsp
Copy link
Member Author

fonsp commented Mar 14, 2022

Maybe the set_value function from @use_state could also be invalidated when I shift+run the cell? I think the broken is that throwing the InterruptException was not working, and the old file watcher is still running. If that old set_state function would error("Invalidated"), then that might solve it

@Pangoraw
Copy link
Member

Pangoraw commented Mar 14, 2022

Maybe the set_value function from @use_state could also be invalidated when I shift+run the cell

That's a great idea! if it throws an error after invalidation that's another way to kill the task.

@fonsp
Copy link
Member Author

fonsp commented May 19, 2022

Something like this also does not work:

@use_task([output_dir]) do
	run(`$(Deno_jll.deno()) run --allow-read --allow-net https://deno.land/[email protected]/http/file_server.ts`)
end

When you re-run the cell, the old server is still running while the new one is starting up, which gives error: Uncaught (in promise) AddrInUse: Address already in use (os error 48).

I think we should await shutting down the last task before starting the next one?

@Pangoraw Pangoraw added enhancement New feature or request upstream Requires fix in Pluto.jl labels Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream Requires fix in Pluto.jl
Projects
None yet
Development

No branches or pull requests

2 participants