Skip to content

Commit 4c3de86

Browse files
Merge pull request #636 from oliver-sanders/shutdown-subproc-pool-backport
shutdown: terminate subprocesses
2 parents 0b9f11d + a75fdb4 commit 4c3de86

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
@@ -580,10 +580,17 @@ def launch_instance(cls, argv=None, workflow_id=None, **kwargs):
580580
async def stop_extension(self):
581581
# stop the async scan task
582582
await self.workflows_mgr.stop()
583+
584+
# stop active subscriptions
583585
for sub in self.data_store_mgr.w_subs.values():
584586
sub.stop()
585-
# Shutdown the thread pool executor
587+
588+
# Shutdown the thread pool executor (used for subscription processing)
586589
self.data_store_mgr.executor.shutdown(wait=False)
590+
591+
# stop the process pool (used for background commands)
592+
self.executor.shutdown()
593+
587594
# Destroy ZeroMQ context of all sockets
588595
self.workflows_mgr.context.destroy()
589596
self.profiler.stop()

0 commit comments

Comments
 (0)