Files
RedBear-OS/local
vasilito 0bb3e6fa4d driver-manager: F2 — reaper panic visibility watchdog
Closes the medium-severity observability gap: a panic in the
SIGCHLD reaper worker is currently invisible to driver-manager.
Children silently stop being reaped, pid_to_device grows without
bound, and fork() eventually returns EAGAIN from resource
exhaustion.

Adds a watchdog thread that polls handle.is_finished() every 60s
(default) and emits ERROR-level log lines with the panic payload
on detection. Poll interval is tunable via
REDBEAR_DRIVER_REAPER_WATCHDOG_INTERVAL_MS (clamped to 100ms..=60s
to bound CPU use).

main.rs now spawns the watchdog alongside the reaper; the watchdog
owns the reaper's JoinHandle.

Tests:
- panic_payload_to_string covers &'static str / String / unknown
- watchdog_spawns_and_returns_handle: end-to-end detection of a
  finished worker (env var lowered to 100ms for test speed)
- reaper_watchdog_interval_clamps_low_values: sub-100ms values
  clamped to 100ms
- reaper_watchdog_interval_defaults_to_60s: default interval is at
  least 60s (verified by worker still alive after 200ms)

All 122 driver-manager tests pass.
2026-07-27 12:27:11 +09:00
..