Skip to content

fix: extend --job-array-* now tracks and reports per-instance reload failures - #518

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/512-job-array-reload-error
Aug 19, 2026
Merged

fix: extend --job-array-* now tracks and reports per-instance reload failures#518
scttfrdmn merged 1 commit into
mainfrom
fix/512-job-array-reload-error

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

  • extendJobArrayWithAudit discarded triggerReload's per-instance error with _ = triggerReload(&inst), unlike the single-instance runExtend path, which warns and prints a manual ssh ... sudo spored reload fallback on a reload failure.
  • A caller extending a job array of N instances had no way to tell which instances actually picked up the new TTL on-instance vs. which are silently running on stale config until the next periodic tag refresh (5 minutes in production).
  • Extracted the per-instance tag-write + reload loop into extendJobArrayInstances(instances, updateTags, reload, stderr) so the accounting is unit-tested without a real AWS client or SSH. Reload failures are now tracked in a separate reloadFailedInstances list, printed with the same manual-fallback message as the single-instance path, and reflected in the summary output (Reloaded: N/M instances) and audit log (reload_failed_count).

Test plan

  • go build ./...
  • go vet ./cmd/...
  • go test ./cmd/... — new tests: TestExtendJobArrayInstances_ReloadFailureIsTrackedNotDiscarded, TestExtendJobArrayInstances_TagFailureSkipsReload, TestExtendJobArrayInstances_AllSucceed
  • golangci-lint run ./cmd/... — no new findings in touched files (pre-existing findings in unrelated files unchanged)
  • CHANGELOG.md updated under [Unreleased]

Fixes #512

…failures

triggerReload's error was discarded with `_ = triggerReload(&inst)` in the
job-array path, unlike the single-instance path which warns and prints a
manual SSH fallback. A caller extending N instances had no signal, per
instance, about whether the on-instance reload actually happened vs. just
the tag write.

Extracted the per-instance update+reload loop into extendJobArrayInstances
so the accounting is unit-tested without a real AWS client or SSH.

Fixes #512
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.82759% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/extend.go 44.82% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 2bc9ea7 into main Aug 19, 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 --job-array-*: triggerReload's per-instance SSH failure is silently discarded

1 participant