Skip to content

fix: Reload propagates a failed config refresh instead of swallowing it - #511

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/505-reload-swallows-errors
Aug 18, 2026
Merged

fix: Reload propagates a failed config refresh instead of swallowing it#511
scttfrdmn merged 1 commit into
mainfrom
fix/505-reload-swallows-errors

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Agent.Reload logged a failed ec2:DescribeTags call (RefreshConfig's error) as a warning and continued, adopting whatever stale config the provider already had cached. handleReload/spored reload then unconditionally printed "✓ Configuration reloaded successfully", and spawn extend's SSH-triggered reload printed "✓ Configuration reloaded on instance" — both reporting success for an operation that changed nothing on the instance.

Reload now returns the refresh error directly. This propagates correctly through the existing call chain with no other changes needed: handleReload already wraps and returns Reload's error, main() already exits non-zero on a RunE error, and cmd/extend.go's triggerReload already reports the SSH command's exit code as a failure.

Found live while diagnosing a field report for #502 — an instance's spawn extend printed "✓ Configuration reloaded on instance" while spored status on the same instance, moments later, still showed TTL: none — instance will not auto-terminate.

Fixes #505.

Test plan

  • New tests TestReload_Success and TestReload_RefreshConfigFailurePropagates — the latter verified to fail without the fix (asserted via git stash on agent.go) and pass with it
  • go build ./..., go vet ./..., go test ./pkg/agent/... ./cmd/... all clean
  • golangci-lint run ./pkg/agent/... — no new findings in touched code
  • CHANGELOG.md updated under ## [Unreleased]

Agent.Reload logged a failed ec2:DescribeTags call as a warning and
continued as if it had succeeded, so `spored reload` (and therefore
`spawn extend`'s SSH-triggered reload) reported success while the daemon
kept running on stale, possibly zero-value config. Reload now returns
the refresh error, which propagates through spored reload's exit code
and extend's SSH invocation.

Fixes #505
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 9cffc50 into main Aug 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extend: Reload/handleReload report success even when the on-instance config refresh (DescribeTags) failed

1 participant