[SIGNIFICANT] kill_others fires before service start -- race with port binding #23

Open
opened 2026-05-11 10:52:01 +00:00 by thabeta · 1 comment
Owner

Problem

kill_others runs BEFORE spawning the service in spawn_service. If kill_others fails to kill some processes (partial failure), the service proceeds to start anyway.

The service may then fail to bind its declared ports because the conflicting processes are still running. However, since the spawn itself succeeded, the service is marked as Running -- it's actually broken but the supervisor doesn't know.

Impact

Services appear healthy but are non-functional because they couldn't bind to their ports. The supervisor reports success while the service is silently broken.

Files

  • crates/my_init_server/src/supervisor/spawning.rs -- kill_others handling in spawn_service

Suggested Fix

  • If kill_others has partial failures, abort the spawn and mark the service as Failed
  • Or verify port availability after spawn and before marking Running
## Problem `kill_others` runs BEFORE spawning the service in `spawn_service`. If `kill_others` fails to kill some processes (partial failure), the service proceeds to start anyway. The service may then fail to bind its declared ports because the conflicting processes are still running. However, since the spawn itself succeeded, the service is marked as `Running` -- it's actually broken but the supervisor doesn't know. ## Impact Services appear healthy but are non-functional because they couldn't bind to their ports. The supervisor reports success while the service is silently broken. ## Files - `crates/my_init_server/src/supervisor/spawning.rs` -- `kill_others` handling in `spawn_service` ## Suggested Fix - If `kill_others` has partial failures, abort the spawn and mark the service as Failed - Or verify port availability after spawn and before marking Running
Member

Classification: valid-bug — kill_others runs before spawning; if it partially fails, service starts and is marked Running even though it may be unable to bind ports.

Per the issue description referencing crates/my_init_server/src/supervisor/spawning.rs: kill_others runs before spawn_service completes. A partial failure where conflicting processes survive means the spawned service cannot bind declared ports, but since spawn succeeded, the supervisor marks it Running.

> Classification: valid-bug — kill_others runs before spawning; if it partially fails, service starts and is marked Running even though it may be unable to bind ports. Per the issue description referencing crates/my_init_server/src/supervisor/spawning.rs: kill_others runs before spawn_service completes. A partial failure where conflicting processes survive means the spawned service cannot bind declared ports, but since spawn succeeded, the supervisor marks it Running.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_init#23
No description provided.