Investigate Process Filtering #9

Open
opened 2026-01-27 14:13:55 +00:00 by rawan · 1 comment
Member

Issue: Service Blocked Indefinitely with .process_filter() and .kill_others()

Problem Summary

When using .process_filter("embedderd") combined with .kill_others(), the zinit service gets stuck in a blocked state indefinitely during startup.

To reproduce:

1- run zinit-server
2- run embedderd --start
3- run zinit list

Root Cause

Deadlock between parent and service process:

  1. embedderd --start runs (Process A)
  2. Process A registers itself with zinit using .process_filter("embedderd")
  3. Zinit starts a new instance (Process B) as a managed service
  4. The process filter detects BOTH processes match "embedderd"
  5. kill_others() tries to kill conflicting processes but creates a deadlock:
    • Process A is waiting for Process B to start
    • Process B can't fully start because Process A is still running (detected as conflict)
    • Neither process can proceed, resulting in permanent block

Why This Happens

  • .process_filter() monitors ALL processes matching the pattern
  • The parent process (still running) is considered a "conflict"
  • Zinit's conflict resolution doesn't handle self-registering services properly

Workaround

Remove .process_filter("embedderd") - only use .kill_others() for port-based conflict detection

image

image

image

## Issue: Service Blocked Indefinitely with `.process_filter()` and `.kill_others()` ### Problem Summary When using `.process_filter("embedderd")` combined with `.kill_others()`, the zinit service gets stuck in a blocked state indefinitely during startup. ### To reproduce: 1- run zinit-server 2- run `embedderd --start` 3- run `zinit list` ### Root Cause **Deadlock between parent and service process:** 1. `embedderd --start` runs (Process A) 2. Process A registers itself with zinit using `.process_filter("embedderd")` 3. Zinit starts a new instance (Process B) as a managed service 4. The process filter detects BOTH processes match "embedderd" 5. `kill_others()` tries to kill conflicting processes but creates a deadlock: - Process A is waiting for Process B to start - Process B can't fully start because Process A is still running (detected as conflict) - Neither process can proceed, resulting in permanent block ### Why This Happens - `.process_filter()` monitors ALL processes matching the pattern - The parent process (still running) is considered a "conflict" - Zinit's conflict resolution doesn't handle self-registering services properly ### Workaround Remove `.process_filter("embedderd")` - only use `.kill_others()` for port-based conflict detection ![image](/attachments/79966583-8908-40d4-bf91-04ca20cd3d2f) ![image](/attachments/c6172c32-13d4-45f4-9b40-37144ff72ce0) ![image](/attachments/1e4a971b-8f93-432e-b49b-6c2291cc82f4)
Owner

should be fixed in geomind_code/zinit@03b0f96c8a

should be fixed in https://forge.ourworld.tf/geomind_code/zinit/commit/03b0f96c8aeba9fa30531e5317d10704d8dab544
Sign in to join this conversation.
No labels
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/zinit#9
No description provided.