Skip to content

Keep battery pool metric cache and resend 0 W after failed commands - #1469

Open
shsms wants to merge 4 commits into
frequenz-floss:v1.x.xfrom
shsms:pool-cache-and-zero-retry
Open

shsms wants to merge 4 commits into
frequenz-floss:v1.x.xfrom
shsms:pool-cache-and-zero-retry

Conversation

@shsms

@shsms shsms commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Two battery-control bugs: the battery pool could briefly report no power bounds when batteries rejoined the working set, which made the power manager zero the target power, and a 0 W request after a failed one could be skipped as a repeat.

Changes

  • SendOnUpdate no longer drops cached metrics when a battery leaves the working set. A battery that comes back counts at once instead of after its next sample. Freshness is already handled by the metric fetchers' 2 s timeout and the status trackers. Pinned by test_power_bounds_when_working_batteries_swap.
  • BatteryManager forgets the last set power of an inverter whose request failed or timed out, so the next request is sent even if it is 0 W. The failed request may have been applied. Pinned by test_resend_0w_after_failure.
  • Test-only: start_streaming_power_bounds is extracted from run_power_bounds_test so the new test can give one battery different inverter bounds.
  • Both fixes have Bug Fixes entries in RELEASE_NOTES.md.

@shsms
shsms requested a review from a team as a code owner October 8, 2026 12:50
@shsms
shsms requested review from florian-wagner-frequenz and removed request for a team October 8, 2026 12:50
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:data-pipeline Affects the data pipeline part:microgrid Affects the interactions with the microgrid labels Oct 8, 2026
shsms added 4 commits October 8, 2026 15:11
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Used in the following commit, which needs the same setup with different
inverter bounds for each battery.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Dropping the cached data meant a battery rejoining the working set was
ignored until its next sample, so the power bounds could briefly vanish
and the power manager forced the target to zero. The metric fetchers
already clear stale data, and the status trackers stop using batteries
with stale data.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
A command that failed or timed out may still have been applied. When the
last successful command was 0 W, a following 0 W command was skipped as
a repeat, so the battery could keep running the failed command's power.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@shsms
shsms force-pushed the pool-cache-and-zero-retry branch from 52b11ad to 89e3673 Compare October 8, 2026 13:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

1 participant