Skip to content

Commit

Permalink
Merge pull request #619 from oliver-sanders/shutdown-subproc-pool
Browse files Browse the repository at this point in the history
shutdown: terminate subprocesses
  • Loading branch information
wxtim committed Aug 14, 2024
2 parents f3f4b01 + 8cb81dd commit 3cfed33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes.d/619.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down.
9 changes: 8 additions & 1 deletion cylc/uiserver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 3cfed33

Please sign in to comment.