Skip to content

Session persistence can delay EV safety stops and the control loop #1247

Closed

Description

@frahlg

A loadpoint tick currently restores or saves its session before sending its explicit safety stop. A blocked state.db write therefore delays the stop, including stops for later chargers in the same loop.

The local regression TestSafetyStopsAllChargersBeforeBlockedSessionSave configures two connected chargers and blocks a session checkpoint. Both cases fail on Core commit 67439f4: stale site-meter permission and unavailable charger power. Neither charger receives the zero-W command before the checkpoint blocks. The test releases the blocked write during cleanup; it does not touch hardware.

The storage candidate based on #1240 now sends all applicable zero-W safety commands before any session IO. The regression and the complete loadpoint race suite pass. It preserves saved goals and keeps the existing driver-health and resume handling.

Scope limit: this fixes the ordering when a safety condition is already known at tick entry. It does not prove that a new fault arriving while an earlier normal tick is blocked can preempt that tick. Core also sends site-stale driver defaults before loadpoint processing, but the main control loop still contains synchronous session, vehicle-anchor and battery-model persistence. These paths need a separate blocked-IO control-loop test and isolation before claiming that storage cannot delay control.

Related: #1246 records the measured multi-second fsync waits during backup on Raspberry Pi. Keep that release gate open; do not describe this ordering fix as complete isolation from stalled storage.

Activity

  1. added
    release-blocker
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    release-blocker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions