fix(reliability): supervisor re-parks stock-resurrected dummy STA on interval

This commit is contained in:
2026-08-22 18:31:06 -06:00
parent 5625310977
commit b9a64c6560
2 changed files with 36 additions and 0 deletions
@@ -4719,6 +4719,7 @@ def _mem_percent(path='/proc/meminfo'):
MEM_WARN_PERCENT = 85
MEM_WARN_STREAK = 5
HEALTH_STA_PARK_INTERVAL = 4 # every Nth health tick (~1/min at 15s poll)
def health_check():
@@ -4755,6 +4756,21 @@ def health_check():
# does not bring secondary monitors back). Repair them without cooldown.
if _monitor_down('wlan1mon') or _monitor_down('wlan0mon'):
_bring_monitors_up(h)
# The stock daemon re-enables its dummy STA during its own config
# reconvergence (e.g. after wifi reloads), silently pinning phy0 again.
# Re-park periodically — parking never runs wifi reload, so it is safe
# to repeat.
h['ticks'] = h.get('ticks', 0) + 1
if h['ticks'] % HEALTH_STA_PARK_INTERVAL == 0 and _sta_uplink_enabled():
try:
_park_dummy_sta()
h['last_action'] = 'dummy STA re-parked'
import mk8_events
mk8_events.log_event('guard_fix',
msg='re-parked dummy_radio0 STA '
'(stock reconvergence)')
except Exception:
pass
h['mem_percent'] = _mem_percent()
if h['mem_percent'] >= MEM_WARN_PERCENT:
h['mem_streak'] = h.get('mem_streak', 0) + 1