ConfigPublishCoordinator dies permanently if ConfigDb is unreachable when its singleton starts, and every deploy then hangs #868

Closed
opened 2026-11-11 12:18:11 -05:00 by dohertj2 · 1 comment
Owner

Observed on docker-dev on 2026-11-11, after an OrbStack restart in which central-1 started before SQL was reachable. ConfigPublishCoordinator.PreStart queries the database synchronously. If that throws, the cluster singleton dies, is never restarted, and every deployment waits forever. Restarting central-1 recovered it.

Fix: move the DB load out of PreStart and retry with backoff (or use a supervisor with restart and backoff), and report Degraded on health until it loads. Add a test with an unreachable DB at start that then recovers.

Observed on docker-dev on 2026-11-11, after an OrbStack restart in which central-1 started before SQL was reachable. `ConfigPublishCoordinator.PreStart` queries the database synchronously. If that throws, the cluster singleton dies, is never restarted, and every deployment waits forever. Restarting central-1 recovered it. **Fix:** move the DB load out of PreStart and retry with backoff (or use a supervisor with restart and backoff), and report Degraded on health until it loads. Add a test with an unreachable DB at start that then recovers.
dohertj2 added the priority:p2type:bug labels 2026-11-11 12:18:11 -05:00
Author
Owner

Done after four review rounds. The coordinator loads asynchronously with backoff and stashes messages meanwhile. Other changes: recovered fully-acked deployments seal; acks are persisted before they count, with bounded retry; permanent ack-write failures are recognised only from a SQL error-number allowlist; node rows stay Applying until the outcome is known; terminal states are written once; failure reasons are truncated to the column length; cache-booted and stale-recovered revisions are treated as unconfirmed; a config-publish health check is added. Host.IntegrationTests 299/299. Pushed to master in e857135e..7a27ef1f; full suite green (20 projects, 0 failures, 0 warnings).

Done after four review rounds. The coordinator loads asynchronously with backoff and stashes messages meanwhile. Other changes: recovered fully-acked deployments seal; acks are persisted before they count, with bounded retry; permanent ack-write failures are recognised only from a SQL error-number allowlist; node rows stay Applying until the outcome is known; terminal states are written once; failure reasons are truncated to the column length; cache-booted and stale-recovered revisions are treated as unconfirmed; a config-publish health check is added. Host.IntegrationTests 299/299. Pushed to master in `e857135e..7a27ef1f`; full suite green (20 projects, 0 failures, 0 warnings).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#868