Skip to content

Commit

Permalink
tui: prevent hang on shutdown
Browse files Browse the repository at this point in the history
* Add a timeout on the updater shutdown to prevent any hanging operation
  stopping Tui from exiting.
  • Loading branch information
oliver-sanders committed Jun 28, 2024
1 parent 747e2af commit 33aeb2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes.d/fix.6178.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix an issue where Tui could hang when closing.
5 changes: 4 additions & 1 deletion cylc/flow/tui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 33aeb2c

Please sign in to comment.