diff --git a/changes.d/619.fix.md b/changes.d/619.fix.md new file mode 100644 index 00000000..4b67746c --- /dev/null +++ b/changes.d/619.fix.md @@ -0,0 +1 @@ +Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down. diff --git a/cylc/uiserver/app.py b/cylc/uiserver/app.py index bf424d1d..4039cda2 100644 --- a/cylc/uiserver/app.py +++ b/cylc/uiserver/app.py @@ -592,10 +592,17 @@ def launch_instance(cls, argv=None, workflow_id=None, **kwargs): async def stop_extension(self): # stop the async scan task await self.workflows_mgr.stop() + + # stop active subscriptions for sub in self.data_store_mgr.w_subs.values(): sub.stop() - # Shutdown the thread pool executor + + # Shutdown the thread pool executor (used for subscription processing) self.data_store_mgr.executor.shutdown(wait=False) + + # stop the process pool (used for background commands) + self.executor.shutdown() + # Destroy ZeroMQ context of all sockets self.workflows_mgr.context.destroy() self.profiler.stop()