Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ConnectionRefused on first attempt at exporting image #164
I'm running orca in a miniconda container, which is in turn running as a celery service (though probably not relevant).
On the first one or two attempts at generating an image (when kicking off at about the same time, but on separate processes), I get connection refused. On subsequent tries, it works fine, everytime.
At a guess, I suspect the python client isn't waiting long enough for orca to start, but makes it through on a warm restart when orca starts a bit quicker?
Thanks for letting us know. What's happening here is that plotly.py launches orca as a server process the first time you export an image. It does have a robust retry policy for communicating with the server, it just currently gives up after 8 seconds
This number is admittedly a bit arbitrary, and it sounds like we should increase it. I've opened a plotly.py issue for this at plotly/plotly.py#1297.
In the meantime, here's a workaround. You can ask plotly.py to start the orca process manually (before you call
import plotly import time plotly.io.orca.ensure_server() time.sleep(10)
This will give the server an extra 10 seconds to startup (in addition to the 8 seconds that
I'm going to close this issue in favor of plotly/plotly.py#1297 since this is a plotly.py, not orca, issue. Thanks!