py-spy showed per-cycle atomic param writes were the dominant cost. Each put() is mkstemp+fsync+flock+rename+fsync_dir — fine when rare, ruinous at 100Hz. At park with no state changes, these writes were running anyway and the flock contention was poisoning the whole system. carstate.py (update + update_canfd): CarSpeedLimit, CarIsMetric, CarCruiseDisplayActual were written every CAN update. Now cached and written only on change. controlsd.py: same fix for LatRequested and no_lat_lane_change. Also throttle the sentry crash-file stat() from 100Hz to 1Hz. Also: suppress locationdTemporaryError/paramsdTemporaryError/posenetInvalid on lat engage (same 2s window as commIssue), and tie suppression to the LatRequested edge instead of CC.latActive (fires immediately, not after the 250ms ramp-up delay). Also: reset Ratekeeper when it falls >1s behind — the ~6s fingerprinting stall at startup was poisoning the lag metric for the entire session. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 KiB
Executable File
26 KiB
Executable File