Abort the poll cycle on a login failure #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/abort-cycle-on-login-failure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
During a cloud outage the login endpoint timed out. Because the session was
gone, every channel re-attempted its own login — six channels each burning the
full 20s HTTP timeout, so one failed cycle stalled for ~2 minutes and logged six
identical
reading a channel failedwarnings (as seen in production on2026-07-27).
Login is shared by every channel and device, so one failure dooms the whole
cycle. Login errors now carry a
wifipool.ErrLoginFailedsentinel; the pollerstops at the first one, skips the network calls for the remaining devices, and
logs it once:
Staleness is still evaluated and every device rendered (unhealthy), so entities
age out and availability stays correct, and the next cycle recovers on its own
once the cloud responds again.
A single channel-level getStats failure is deliberately unchanged — it is
channel-specific and must not discard readings from the others.
New tests: login attempted once per cycle (not per channel), remaining devices
skipped, recovery on the next cycle, and the sentinel is wrapped. Full suite and
golangci-lint green.