[MINOR] kill_process_tree SIGKILL verify timeout too short #32

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

Problem

After sending SIGKILL in kill_process_tree, the code sleeps 100ms then verifies processes are dead. On a heavily loaded system, 100ms might not be enough for the kernel to reap all processes, especially if they're in uninterruptible sleep (D state).

Impact

kill_process_tree may report partial failures when processes are actually dying but haven't been reaped yet. Or it may miss dead processes that are in D state.

Files

  • crates/my_init_server/src/process.rs -- kill_process_tree

Suggested Fix

Use a retry loop with exponential backoff (e.g., 10ms, 20ms, 50ms, 100ms, 200ms) instead of a single 100ms sleep.

## Problem After sending SIGKILL in `kill_process_tree`, the code sleeps 100ms then verifies processes are dead. On a heavily loaded system, 100ms might not be enough for the kernel to reap all processes, especially if they're in uninterruptible sleep (D state). ## Impact `kill_process_tree` may report partial failures when processes are actually dying but haven't been reaped yet. Or it may miss dead processes that are in D state. ## Files - `crates/my_init_server/src/process.rs` -- `kill_process_tree` ## Suggested Fix Use a retry loop with exponential backoff (e.g., 10ms, 20ms, 50ms, 100ms, 200ms) instead of a single 100ms sleep.
Member

Classification: valid-bug — kill_process_tree uses single 100ms sleep after SIGKILL; on loaded systems, kernel may not have reaped processes yet.

Fixed 100ms sleep is insufficient under load. Use retry loop with exponential backoff.

> Classification: valid-bug — kill_process_tree uses single 100ms sleep after SIGKILL; on loaded systems, kernel may not have reaped processes yet. Fixed 100ms sleep is insufficient under load. Use retry loop with exponential backoff.
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#32
No description provided.