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

issues with kill_kaleido and restart #8

Closed
disberd opened this issue Aug 11, 2023 · 0 comments · Fixed by #14
Closed

issues with kill_kaleido and restart #8

disberd opened this issue Aug 11, 2023 · 0 comments · Fixed by #14

Comments

@disberd
Copy link
Member

disberd commented Aug 11, 2023

There seem to be some weird behavior with killing and restarting the process.

For what concerns killing, at least in the master code, killing kaleido does not seem to actually stop the underlying process as savefig can still be called and execute succesfully.

Try the following code:

using PlotlyKaleido
using PlotlyBase

begin
	PlotlyKaleido.start()
	PlotlyKaleido.kill_kaleido()
	@info "Immediately" PlotlyKaleido.is_running()
	sleep(0.1)
	@info "After sleep" PlotlyKaleido.is_running()
	savefig(Plot(rand(4)), "test.png") # This should not work but it correctly saves the figure
end

which outputs

┌ Info: Immediately
└   PlotlyKaleido.is_running() = true
┌ Info: After sleep
└   PlotlyKaleido.is_running() = false
"test.png"

and correctly generate the png file.

The issue with is_running() only returning false after a small amount of time after a call to kill_kaleido() is what also cause issues with restart() as the command has to be called twice to actually restart the process, as the call here:

restart() = (kill_kaleido(); start())
function start()
is_running() && return

will simply exit from start() called immediately after kill_kaleido() because the process is seen as running still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant