mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-26 07:24:46 +00:00
Closes #47489 The search worker pool was sized as `num_cpus - 1`, which spawned zero workers when a devcontainer exposed only 1 CPU. All search channels closed immediately and the search yielded zero results, while file finder and LSP symbols worked fine. The fix ensures at least 1 worker is always spawned: `(num_cpus - 1).max(1)`. A `num_cpus` override on `TestDispatcher` and a new test reproduce the bug with `server_cx.executor().set_num_cpus(1)`. ## Manual testing Add a `.devcontainer/` directory to a new project with these files: ``` // docker-compose.yml services: dev: image: debian:bookworm-slim cpuset: "0" volumes: - ..:/workspace:cached command: sleep infinity ``` ``` // devcontainer.json { "name": "zed-sandbox (1 CPU)", "dockerComposeFile": "docker-compose.yml", "service": "dev", "workspaceFolder": "/workspace" } ``` Build zed and point it at the new project: ``` cargo run -p zed -- ~/Repos/zed-sandbox-project ``` Open the built-in terminal, confirm `nproc` prints `1`. Finally, run a project search (`Cmd+Shift+F`) and search for contents that exist in it. Results should appear 🎉 Release Notes: - Fixed project search returning no results in devcontainers with a single visible CPU. |
||
|---|---|---|
| .. | ||
| src | ||
| build.rs | ||
| Cargo.toml | ||
| LICENSE-GPL | ||