[PR #11602] fix(desktop): kill zombie server process on startup timeout #13859

Closed
opened 2026-02-16 18:18:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11602

State: closed
Merged: Yes


What does this PR do?
Server health check times out after 7 seconds but spawned process was never killed, leaving zombie processes. Added child.kill() call before returning timeout error in spawn_local_server().

This prevents multiple zombie opencode-server processes from accumulating, which wastes system resources and can cause port conflicts on restart.

How did you verify your code works?

I did NOT fully test this. I tried cargo check but it took 5 minutes downloading/compiling hundreds of dependencies, then failed because opencode-cli sidecar binary doesn't exist in this environment.

The fix follows the same pattern already used at line 66 in the codebase (let _ = child.kill()), so I'm confident the syntax is correct. But I couldn't verify actual runtime behavior since building the full desktop app requires more setup than I have.

A maintainer with proper build environment should verify by:

  1. Blocking server startup (e.g., holding port 4096)
  2. Letting 7 second timeout elapse
  3. Checking that zombie process gets killed
  4. Confirming no port conflict on retry
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11602 **State:** closed **Merged:** Yes --- What does this PR do? Server health check times out after 7 seconds but spawned process was never killed, leaving zombie processes. Added child.kill() call before returning timeout error in spawn_local_server(). This prevents multiple zombie opencode-server processes from accumulating, which wastes system resources and can cause port conflicts on restart. How did you verify your code works? I did NOT fully test this. I tried cargo check but it took 5 minutes downloading/compiling hundreds of dependencies, then failed because opencode-cli sidecar binary doesn't exist in this environment. The fix follows the same pattern already used at line 66 in the codebase (let _ = child.kill()), so I'm confident the syntax is correct. But I couldn't verify actual runtime behavior since building the full desktop app requires more setup than I have. A maintainer with proper build environment should verify by: 1. Blocking server startup (e.g., holding port 4096) 2. Letting 7 second timeout elapse 3. Checking that zombie process gets killed 4. Confirming no port conflict on retry
yindo added the pull-request label 2026-02-16 18:18:41 -05:00
yindo closed this issue 2026-02-16 18:18:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13859