From 33aeb2c12a2f50141fa28eb6e235af594f740327 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Fri, 28 Jun 2024 09:47:19 +0100 Subject: [PATCH] tui: prevent hang on shutdown * Add a timeout on the updater shutdown to prevent any hanging operation stopping Tui from exiting. --- changes.d/fix.6178.md | 1 + cylc/flow/tui/app.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes.d/fix.6178.md diff --git a/changes.d/fix.6178.md b/changes.d/fix.6178.md new file mode 100644 index 00000000000..7d1b9b0f3f6 --- /dev/null +++ b/changes.d/fix.6178.md @@ -0,0 +1 @@ +Fix an issue where Tui could hang when closing. diff --git a/cylc/flow/tui/app.py b/cylc/flow/tui/app.py index 783f1217cc8..eb9f8dec09c 100644 --- a/cylc/flow/tui/app.py +++ b/cylc/flow/tui/app.py @@ -216,7 +216,10 @@ def updater_subproc(filters, client_timeout): yield updater finally: updater.terminate() - p.join() + p.join(4) # timeout of 4 seconds + if p.exitcode is None: + # updater did not exit within timeout -> kill it + p.terminate() class TuiApp: