fix(tui): close slash_worker in _finalize_session to prevent zombie processes #38095 - #38218
Closed
kyssta-exe wants to merge 1 commit into
Closed
fix(tui): close slash_worker in _finalize_session to prevent zombie processes #38095#38218kyssta-exe wants to merge 1 commit into
kyssta-exe wants to merge 1 commit into
Conversation
…rocesses When a TUI session is closed, _finalize_session() was not cleaning up the _SlashWorker subprocess. This left orphaned processes accumulating each time the TUI was opened/closed while the dashboard remained running. _add slash_worker cleanup to _finalize_session() so any code path that calls it (session close, shutdown, error recovery) properly terminates the worker subprocess. Fixes NousResearch#38095
Collaborator
|
Likely duplicate of #38114 — both fix #38095 by closing |
Contributor
|
Superseded by #42132 (merged), which closes the slash_worker subprocess leak via two guards: process-group kill on PTY teardown + a cross-platform parent-death watchdog in the worker. Closing as resolved — thanks for tackling this; the merged fix salvaged the process-group-kill and watchdog approaches with contributor authorship preserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a TUI session is closed, was not cleaning up the subprocess. This left orphaned processes accumulating each time the TUI was opened and closed while the dashboard remained running.
Problem
handles memory commits, notification stops, and DB session ending, but does not close the subprocess. Code paths that call without separately handling worker cleanup (e.g., TUI close without explicit RPC) leave zombie processes.
Fix
Add slash_worker cleanup to so any code path that calls it properly terminates the worker subprocess. The method is idempotent (checks before terminating), so double-close from is safe.
Testing
Fixes #38095