mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-19 19:01:42 +00:00
fix(vpcd,viperblockd): retry NATS connect for ISO firstboot resilience
Both services used one-shot utils.ConnectNATS in launchService. On ISO firstboot, when nats.service is starting in parallel, the dial can race ahead of NATS being ready and exit non-zero. systemd's Restart=on-failure with default StartLimitBurst=5 in 10s burns through the budget in ~25s and the unit enters failed permanently — DHCP manager never starts, vpc.dhcp.acquire requests hit no-responders and the install hangs nondeterministically. Match daemon/awsgw, which already use ConnectNATSWithRetry (5min exponential backoff). The newDHCPManagerWithRetry guard (mulga-siv-40) only helps after the dial succeeds.
This commit is contained in:
@@ -171,7 +171,7 @@ func (svc *Service) Reload() (err error) {
|
||||
|
||||
func launchService(cfg *Config) (err error) {
|
||||
// Connect to NATS
|
||||
nc, err := utils.ConnectNATS(admin.DialTarget(cfg.NatsHost), cfg.NatsToken, cfg.NatsCACert)
|
||||
nc, err := utils.ConnectNATSWithRetry(admin.DialTarget(cfg.NatsHost), cfg.NatsToken, cfg.NatsCACert)
|
||||
if err != nil {
|
||||
slog.Error("Failed to connect to NATS", "err", err)
|
||||
return err
|
||||
|
||||
@@ -301,7 +301,7 @@ func launchService(cfg *Config) error {
|
||||
slog.Info("OVN preflight passed (br-int exists, ovn-controller running)")
|
||||
|
||||
// Connect to NATS
|
||||
nc, err := utils.ConnectNATS(admin.DialTarget(cfg.NatsHost), cfg.NatsToken, cfg.NatsCACert)
|
||||
nc, err := utils.ConnectNATSWithRetry(admin.DialTarget(cfg.NatsHost), cfg.NatsToken, cfg.NatsCACert)
|
||||
if err != nil {
|
||||
slog.Error("Failed to connect to NATS", "err", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user