zed/crates/remote_server
Oliver Azevedo Barnes 3b81feb7c3
devcontainer: Fix project search returning no results on single-CPU containers (#48798)
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.
2026-02-09 18:53:31 +01:00
..
src devcontainer: Fix project search returning no results on single-CPU containers (#48798) 2026-02-09 18:53:31 +01:00
build.rs releases: Add build number to Nightly builds (#42990) 2025-11-24 13:34:04 +01:00
Cargo.toml Add SSH remote server for Windows (#47460) 2026-01-24 13:15:01 -05:00
LICENSE-GPL