Skip to content

fix(lsp): drain server stderr and kill the server with its client - #495

Merged
mrnasil merged 1 commit into
mainfrom
fix/lsp-child-lifecycle
Nov 25, 2026
Merged

mrnasil merged 1 commit into
mainfrom
fix/lsp-child-lifecycle

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

Two process-lifecycle bugs in the LSP client.

  • Unread stderr. The server's stderr was piped and never read. A server that logs there (most do) filled the pipe, then blocked mid-reply, so every request after that timed out. A task now reads stderr to the end and logs each line at debug level.
  • Orphaned servers. kill_on_drop was set only under cfg(test). A dropped client (idle eviction, session end) left running any server that ignores stdin EOF. It is now set always.

Test: a new fake-server mode, stderr_flood, writes 900 KB to stderr before answering initialize. Without the drain, initialize fails; I checked. LSP has 100% line coverage except two lines that are also missed on main.

🤖 Generated with Claude Code

- stderr was piped and never read. A server that logs there (most do)
  filled the pipe and then blocked mid-reply, so every request after
  that timed out. A task now reads it to the end, logging at debug.
- kill_on_drop was set only under cfg(test). A dropped client (idle
  eviction, session end) left a server that ignores stdin EOF running.
  It is now set always.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil enabled auto-merge (squash) November 25, 2026 15:25
@mrnasil
mrnasil merged commit b25694e into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/lsp-child-lifecycle branch November 25, 2026 15:41
@mrnasil mrnasil mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant