From a75fdb403de6bec28f0ed7a83b23df6362117d85 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Wed, 7 Aug 2024 15:38:30 +0100 Subject: [PATCH 1/3] shutdown: terminate subprocesses * We use a subprocess pool for running backgorund commands (e.g. `cylc clean`). * This creates subprocesses to run our commands in, however, it does not kill the subprocess once the command has completed, it keeps the subprocess open for future reuse (more efficient than creating and destroying them every time). * On shutdown we need to close the pool to mop up these subprocesses (this doesn't happen automatically). --- changes.d/619.fix.md | 1 + cylc/uiserver/app.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changes.d/619.fix.md 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 c4caae78..3e41dc60 100644 --- a/cylc/uiserver/app.py +++ b/cylc/uiserver/app.py @@ -580,10 +580,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() From a27d343637e9324f12957e2e90171bbf5260b6f3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:53:37 +0000 Subject: [PATCH 2/3] Prepare release 1.5.1 Workflow: Release stage 1 - create release PR, run: 30 --- CHANGES.md | 10 ++++++++++ changes.d/+dfccb67d.ui-version.md | 1 - changes.d/607.fix.md | 1 - changes.d/619.fix.md | 1 - cylc/uiserver/__init__.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 changes.d/+dfccb67d.ui-version.md delete mode 100644 changes.d/607.fix.md delete mode 100644 changes.d/619.fix.md diff --git a/CHANGES.md b/CHANGES.md index 3739b58d..3ebdd00d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,16 @@ $ towncrier create ..md --content "Short description" +## cylc-uiserver-1.5.1 (Released 2024-10-15) + +[Updated cylc-ui to 2.6.0](https://github.com/cylc/cylc-ui/blob/master/CHANGES.md) + +### 🔧 Fixes + +[#607](https://github.com/cylc/cylc-uiserver/pull/607) - Log any errors when trying to list the workflow/job log files in the UI. + +[#619](https://github.com/cylc/cylc-uiserver/pull/619) - Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down. + ## cylc-uiserver-1.5.0 (Released 2024-06-18) [Updated cylc-ui to 2.5.0](https://github.com/cylc/cylc-ui/blob/master/CHANGES.md) diff --git a/changes.d/+dfccb67d.ui-version.md b/changes.d/+dfccb67d.ui-version.md deleted file mode 100644 index 1ff50218..00000000 --- a/changes.d/+dfccb67d.ui-version.md +++ /dev/null @@ -1 +0,0 @@ -Updated cylc-ui to 2.6.0 diff --git a/changes.d/607.fix.md b/changes.d/607.fix.md deleted file mode 100644 index ba5320f4..00000000 --- a/changes.d/607.fix.md +++ /dev/null @@ -1 +0,0 @@ -Log any errors when trying to list the workflow/job log files in the UI. diff --git a/changes.d/619.fix.md b/changes.d/619.fix.md deleted file mode 100644 index 4b67746c..00000000 --- a/changes.d/619.fix.md +++ /dev/null @@ -1 +0,0 @@ -Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down. diff --git a/cylc/uiserver/__init__.py b/cylc/uiserver/__init__.py index d84ff5ee..b4552c60 100644 --- a/cylc/uiserver/__init__.py +++ b/cylc/uiserver/__init__.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = "1.5.1.dev" +__version__ = "1.5.1" import os from typing import Dict From 87ca49e258fb753127adb51e2bb1841d7d5dc61f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:19:19 +0100 Subject: [PATCH 3/3] Bump dev version (#639) --- cylc/uiserver/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cylc/uiserver/__init__.py b/cylc/uiserver/__init__.py index b4552c60..88c86c7d 100644 --- a/cylc/uiserver/__init__.py +++ b/cylc/uiserver/__init__.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = "1.5.1" +__version__ = "1.5.2.dev" import os from typing import Dict