mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-06 15:25:08 +00:00
fix(plugins): a busy-lock update skip is report-only, never a breaker failure
When the update worker gives up waiting for a plugin's lock (PLUGIN_LOCK_TIMEOUT, 5s) the skip was recorded as a hang, so three in a row opened the circuit breaker. Vegas prefetch holds a plugin's lock for its whole content render, which on a slow Pi can outlast 5s, so a healthy plugin could be pulled from rotation. The skip is now report-only: still logged (rate-limited) and still left as PluginBusyError state error info with last-update stamped, but in health it is counted as a busy skip (busy_skip_count / last_busy_skip, via the new PluginHealthTracker.record_busy_skip) and never touches the failure streak, last_error or the breaker. Only real hangs -- display() or update() running past the executor timeout -- still count toward the breaker. Busy-skip persistence shares the slow-call throttle (first one saved at once so the web process sees it, then at most once a minute per plugin). Tests prove repeated busy skips never open the breaker and repeated real hangs still do, with busy skips interleaved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,8 +23,10 @@ class PluginBusyError(PluginTimeoutError):
|
||||
"""A plugin's lock stayed held past its bound.
|
||||
|
||||
Not raised; recorded. The lock is held by the plugin's own display(),
|
||||
update() or on_config_change() -- one that is hung or far slower than it
|
||||
should be -- so the caller skipped the plugin rather than wait on it.
|
||||
update(), on_config_change() or a Vegas content render -- slow, or hung
|
||||
-- so the caller skipped the plugin rather than wait on it. Report-only:
|
||||
it is kept as the plugin's state error info and counted as a busy skip in
|
||||
health, never as a failure, so it cannot open the circuit breaker.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user