Skip to content

v0.7.10 — one reload per config entry, not one per entity

Choose a tag to compare

@petergCA petergCA released this 07 Aug 17:53
· 9 commits to main since this release

Follow-up to v0.7.9, found by reading the live logs after installing it.

What 0.7.9 missed

0.7.9 budgets recovery attempts per entity, but a config-entry reload acts on
the whole entry. A real Sonos log shows what that means: one offline speaker
owns fourteen entities, and all fourteen dispatched a reload of the same config
entry within ten milliseconds of each other.

0.7.9 already bounded this — each entity spends its budget and stops, so it can't
run all night any more. But fourteen simultaneous reloads of one entry is still a
storm where a single reload would do, and reload storms are their own hazard.

The fix

At most one reload per config entry per housekeeping pass, however many of its
entities are down.

Every sibling that wanted the reload still spends its attempt. That detail
matters: charging only the entity that happened to dispatch would leave the other
thirteen to take turns reloading the entry, one per pass, for hours — trading a
burst for a slow drip.

Nothing changes for single-entity integrations, and nothing changes about the
budget or refund rules introduced in 0.7.9: a reload that works is still free and
still repeatable.

Tests

The new test models the real shape — fourteen entities on one entry. Without the
guard it dispatches 14 reloads, matching the field log line-for-line; with it, 1.

Full changelog: v0.7.9...v0.7.10