fix(restore): do not block on the Signal K start - #34
Conversation
Signal K is ordered behind a provisioning one-shot with no start timeout. A blocking start hangs the restore with no output on a device that has not provisioned since its last upgrade -- which is the normal state of the freshly flashed device this script runs on. verify_signalk already polls for readiness, so nothing is lost. Co-Authored-By: Claude <noreply@anthropic.com>
The readiness poll allows 60s, which covers a start but not a provisioning run -- that installs the curated plugin set before the app may start and is measured at ~72s cold on a CM5, longer on a slow link. Reporting it as "did not come up" sends the operator to debug a device that is working. Co-Authored-By: Claude <noreply@anthropic.com>
|
Correction to this PR's own justification. I wrote " The poll is 30 ×
Not extending the 60s wait is deliberate — provisioning has no deadline of its own, so any number picked here would be arbitrary, and the operator is at the terminal and better served by being told what is happening than by a silent multi-minute wait. |
Why
halos-marine-containers#194 orders
marine-signalk-server-container.servicebehind a provisioning one-shot withTimeoutStartSec=infinity. A plainsystemctl startwaits for the whole start transaction, so it returns only once provisioning finishes.Measured on a HALPI2 with a scratch unit pair of that shape (one-shot sleeping 45s,
Requires=/After=it): plain start45s,--no-block0s.halos-restore.shruns on a freshly flashed device migrating from OpenPlotter, which typically has no uplink configured yet — exactly the state where provisioning waits. The restore would sit at a silent terminal partway through a data migration, andon_exit's recovery restart could hang the same way on the error path.verify_signalkalready polls for readiness, so nothing is lost by not blocking.Note for reviewers
The provisioning marker lives at
<data_root>/.provisionedwhile the restore replaces<data_root>/data, so it survives a restore: after migrating, the device keeps the backup's plugin set and does not re-provision the curated set until the next package upgrade. That is consistent with the gate being scoped to package transactions, but it is a deliberate consequence worth knowing — say so if the migration story should instead bring the device to the curated spec.