Skip to content

Commit 3cfed33

Browse files
authored
Merge pull request #619 from oliver-sanders/shutdown-subproc-pool
shutdown: terminate subprocesses
2 parents f3f4b01 + 8cb81dd commit 3cfed33

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

changes.d/619.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down.

cylc/uiserver/app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,17 @@ def launch_instance(cls, argv=None, workflow_id=None, **kwargs):
592592
async def stop_extension(self):
593593
# stop the async scan task
594594
await self.workflows_mgr.stop()
595+
596+
# stop active subscriptions
595597
for sub in self.data_store_mgr.w_subs.values():
596598
sub.stop()
597-
# Shutdown the thread pool executor
599+
600+
# Shutdown the thread pool executor (used for subscription processing)
598601
self.data_store_mgr.executor.shutdown(wait=False)
602+
603+
# stop the process pool (used for background commands)
604+
self.executor.shutdown()
605+
599606
# Destroy ZeroMQ context of all sockets
600607
self.workflows_mgr.context.destroy()
601608
self.profiler.stop()

0 commit comments

Comments
 (0)