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

shutdown_server() ignoring server process state #372

Open
eth42 opened this issue May 20, 2021 · 2 comments
Open

shutdown_server() ignoring server process state #372

eth42 opened this issue May 20, 2021 · 2 comments

Comments

@eth42
Copy link

eth42 commented May 20, 2021

Hi all,

I am using plotly 4.9.0 installed via pip and orca 1.3.1 installed via npm running on Windows 10. Whenever I invoke any call to orca in a fresh python kernel (currently 3.8.3), I encounter lots of errors suggesting that the communication between plotly and the orca server does not work (see error log below). I followed the steps suggested by Antoine in issue #279 (link to his reply) to separate the orca server start from the python kernel (i.e. start orca in terminal, connect with Plotly later) and observed that setting plotly.io.orca.config.server_url fails when attempting to shutdown the previously running server with a PID not found error. Manually overwriting the plotly.io._orca.orca_state dictionary to {"proc":None,"shutdown_timer":None} solves the issue as plotly forgets, that it is supposed to have an orca server, though this is quite the hack. My suggestion would be to catch any psutil.NoSuchProcess exception when trying to access the previous server and just assume, that the previous server has been dealt with in some other way, though I am not sure, whether this solves the issue at hand or just hides it. At least in the task manager I could not find the corresponding PID from which I would deduce, that the process died quietly.
If you need further diagnostics on the issue just ask away. Having to resort to hacks, like overwriting internal states, to use the package is possible yet somewhat cumbersome.

Cheers
Erik

Corresponding error log: error_log.txt

@nicolaskruchten
Copy link
Contributor

Have you tried switching from Orca to Kaleido for static image export? It's much easier to manage and avoids this kind of issue :)

@eth42
Copy link
Author

eth42 commented May 20, 2021

Not yet, will take a look at it in the future. To be honest, I mostly copy-pasted examples from the plotly docs together (where I seemingly stumbled upon some older pages). I didn't notice, that plotly moved from orca to kaleido yet. Thanks for the advice.

Edit: Just made a quick test, works like a charm.

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

No branches or pull requests

2 participants