# lsp: if language server closes stdout/stderr, break loop \(\#7229\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3107ed847a15dc74601fac33731f65a6fa5a9355)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3107ed847a15dc74601fac33731f65a6fa5a9355

Requested commit: 3107ed847a15dc74601fac33731f65a6fa5a9355

Commit: 3107ed847a15dc74601fac33731f65a6fa5a9355

Tree: 4e00f36110d3b0132dc41e62789684f301e34da3

Author: Thorsten Ball

Committer: GitHub

## Message

```
lsp: if language server closes stdout/stderr, break loop (#7229)

Previously we would run these loops indefinitely when a language server
closed its stdout/stderr and the `read_until` returned `0` bytes read.

Easy to reproduce: start Zed with LSP attached, `kill -9` the LSP, see
logs accumulate.

Release Notes:

- Fix high CPU usage when a language server crashes (or closes its
stdout/stderr on purpose).

Co-authored-by: Julia <julia@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
```

## Parents

- [944a1f8fb0f1d9e65bbcffc8ed064f0f32827828](https://git.cafe/gitcafe/zed/commit/944a1f8fb0f1d9e65bbcffc8ed064f0f32827828?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3107ed847a15dc74601fac33731f65a6fa5a9355?format=markdown)
