Orphaned Orcas from Dash App in Windows compared to Linux when using Plotly py 3.2.0


I have a dash app that produces a series of spectroscopic plots that I am saving using the plotly py 3.2.0 io.write_image syntax. On linux orca seems to behave as I would expect; I get one instance that closes along with the associated python process. On windows, however, each instance of the app appears to be creating its own orca process, and they do not go away when the python process is ended or a cmd is closed.

What should I be doing on windows systems to handle the orca processes?

Thank you.

hi @DNyenhuis,

The intended behavior is the each individual Python process that performs image export operations will get it’s own orca instance (and ‘an orca instance’ is actually 3 or 4 electron processes).

How are you shutting down the Dash process? We rely on the Python atexit mechanism to shut down the orca process when Python exits and there may be cases where this doesn’t get invoked, depending on how the Python process is shut down. According to the atexit docs

Note: The functions registered via this module are not called when the program is killed by a signal not handled by Python, when a Python fatal internal error is detected, or when os._exit() is called.

Perhaps we’ll need to look for ways to shut down the orca process in response to other conditions.

You can shut down this process manually using plotly.io.orca.shutdown_server(). Can you confirm that this successfully shuts down the orca processes for you? Would calling this method manually be a practical workaround for you?