Files
RedBear-OS/local/docs
vasilito c80c23dbb1 driver-manager: F1 — crash counter + backoff + blacklist
Closes the HIGH-severity F1 finding: drivers that crash on every
spawn used to be respawned every hotplug poll (250 ms) indefinitely,
consuming process slots and cluttering logs.

New: per-BDF CrashTracker with:
- consecutive failure counter (HashMap<BDF, CrashState>)
- exponential backoff window: base_ms * 2^N, capped at cap_ms
- auto-blacklist WARN at threshold (default 5)

Env-var configuration:
- REDBEAR_DRIVER_CRASH_THRESHOLD       (default 5)
- REDBEAR_DRIVER_BACKOFF_BASE_MS       (default 100)
- REDBEAR_DRIVER_BACKOFF_CAP_MS        (default 30000)

Probe hot path integration (config.rs::DriverConfig::probe):
- is_in_backoff(bdf) -> ProbeResult::Deferred with reason
- record_success(bdf) on Bind (clears any prior failure state)
- record_failure(bdf) on spawn ENOENT or SIGCHLD reap
- WARN log on threshold-cross with override hint

Reap integration (reap_pid):
- every reap is treated as a spawn failure
- threshold-cross WARN identifies driver + BDF + override path

New /scheme/driver-manager endpoints:
- /crash_count                  (read): lines of '<bdf> <failures>'
- /crash_count/<bdf>            (read): '<bdf> <failures>' (0 if unknown)

Tests (7 new):
- crash_tracker_record_failure_increments_and_signals_threshold
- crash_tracker_record_success_clears_state
- crash_tracker_is_in_backoff_returns_true_within_window
- crash_tracker_snapshot_returns_per_bdf_counts
- crash_tracker_apply_env_overrides
- crash_tracker_apply_env_ignores_invalid_values
- crash_tracker_global_stub_returns_when_unset

141 driver-manager tests pass.
2026-07-27 13:28:48 +09:00
..