Documentation
¶
Overview ¶
Package slotgc detects and removes per-slot directories under .bones/swarm/<slot>/ whose leaf process is no longer alive.
The package lives outside both internal/swarm (to avoid an import cycle: hub → swarm → workspace → hub) and internal/hub (so cli's doctor can read without importing the hub start path). It depends only on the standard library and the path convention .bones/swarm/<slot>/leaf.pid that swarm.SlotDir/SlotPidFile encode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeadSlots ¶
DeadSlots lists slot names under .bones/swarm/<slot>/ whose leaf.pid file points at a process that no longer exists. Slots without a pid file (mid-creation, or already partially cleaned) are skipped — only "had a leaf, leaf is gone" qualifies.
Read-only. Returns nil + nil when the swarm root doesn't exist (workspace never used swarm verbs).
func Kill ¶ added in v0.7.1
Kill terminates pid using the same SIGTERM → poll → SIGKILL pattern as hub.terminateProcess and registry.Reap. Returns true if the process is gone by the time Kill returns. Best-effort: callers treat a false return as "still alive after escalation, give up".
Types ¶
type Slot ¶ added in v0.7.1
Slot pairs a slot name with the pid of its live leaf. Returned by LiveSlots so cli/down can render a meaningful plan and signal each pid in turn.
func LiveSlots ¶ added in v0.7.1
LiveSlots lists slot names under .bones/swarm/<slot>/ whose leaf.pid references a still-alive process. Inverse of DeadSlots; the caller uses this to enumerate processes that bones down should reap. Slots without a pid file are skipped (no leaf to kill).
Read-only. Returns nil + nil when the swarm root doesn't exist.