Skip to content

fix(progress): append unknown steps instead of dropping them silently (#739) - #743

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/739-progress-step-registration
Oct 8, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/739-progress-step-registration

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #739. This is why the #740/#741 stall was invisible; #742 is why it was
long.

24 of 32 step names were no-ops

Start/Complete/Error/Skip scanned a fixed nine-step list and returned
silently on no match. An audit of every name passed from cmd/, with i18n
initialized the way cmd/root.go does it:

32 used / 9 registered / 24 UNREGISTERED

And the 24 were not a random sample:

Verifying spored agent                  (5-minute wait)
Waiting for Windows (password available) (12-minute wait)
Registering DNS                          (4-minute retry budget)
Creating FSx Lustre filesystem ×3, Recalling FSx ×2, Getting FSx info
Reconciling cohort
Uploading ISO to S3, Starting import-disk-image, + 6 more Windows-AMI steps

Every one of spawn's long operations, and nothing else. The eight names that
did match all belong to the fast pre-launch phase — which is exactly why this
survived: everything that printed finished in seconds, and everything slow was
invisible. A reporter watching a launch for five minutes with no output was
watching three consecutive no-op calls.

Appending, not registering

The issue suggested registering the missing names. I went with find-or-append
instead, because a fixed list is the wrong shape for this data:

  • several steps are conditional — FSx, MPI, Windows and cohort reconciliation
    only happen on some launches, so a static list is either incomplete or lists
    steps that will never run;
  • cmd/image.go builds labels in variables (waitLabel, ssmLabel), so no
    static registry could enumerate them even in principle.

With find-or-append the step list describes what this launch actually did, and
the failure mode of a new call site is a visible extra line rather than silence.

Error also now prints its message outside the lookup. It used to sit inside
the matched-step branch, so an unregistered name swallowed the error text as well
as the step line — a failure reported nowhere at all unless the caller
independently returned it.

Second half: a running step was 0 bytes on a non-TTY

displayPlain skipped anything not already complete or error. Measured:

Start("…") on a non-TTY emitted 0 bytes: ""

So on a pipe, a capture, or in CI, a step announced itself only once it had
finished — which is backwards. Knowing what is in flight is the entire value
of progress output on a non-interactive stream, and without it a long wait and a
wedged process are identical. Starts are now logged once each, and skipped is
reported rather than dropped.

The two longest waits also state their ceiling — Verifying spored agent (up to 5 min). A bounded wait that says so is a wait; one that doesn't is a hang.

Verification

revert fails
drop unknown names in stepIndex Start on an unregistered name printed " ? spawn.progress.detecting_ami..." + step count 9 -> 9, want one appended
displayPlain skips running Start emitted nothing on a non-TTY — a step in flight is invisible (#739)

Also asserted: quiet mode (which exists so -o json stays parseable) stays
silent for appended steps too, and a running step is announced once however
many times display() is driven.

gofmt, go vet ./..., go test -short ./..., make check-docs, changelog
gate, semgrep scan --config=auto --error (0 findings).

Found but not fixed

Five names are passed to Complete/Error/Skip but never to Start —
mismatched pairs, all in FSx/cohort paths:

Creating FSx Lustre filesystem (deferred until after launch)   [Skip]
Creating security group                                        [Skip]
FSx Lustre filesystem                                          [Skip]
Recalling FSx filesystem                                       [Error]
Reconciling cohort                                             [Error]

Before this change they vanished; with find-or-append they render as a second,
never-started step, so they are at least visible now. Fixing them means
reading five call sites in code this PR doesn't otherwise touch, so it is left
alone — but TestReportMismatchedStepPairs pins the count at five and fails if a
caller adds another.

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.92683% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_single.go 0.00% 5 Missing ⚠️
pkg/progress/progress.go 94.44% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

An audit of every prog.Start/Complete/Error/Skip name passed from cmd/
found 32 distinct names, of which 24 matched nothing in the tracker's
fixed nine-step list. All four methods scanned the list and `return`ed
SILENTLY on no match, so all 24 calls were no-ops.

The 24 were not a random sample. They were spawn's longest operations:
"Verifying spored agent" (5 min), "Waiting for Windows (password
available)" (12 min), every FSx step, cohort reconciliation,
"Registering DNS", and the entire Windows ISO->AMI import. The eight
that DID match all belong to the fast pre-launch phase — which is
exactly why nobody noticed: everything that printed finished in seconds
and everything slow was invisible. It is also why the #740/#741 stall
showed no output at all.

A fixed registry was the wrong shape. Several steps are conditional
(FSx, MPI, Windows, cohort), and cmd/image.go builds labels in
variables, so no static list can enumerate them. stepIndex now
find-or-appends, and the step list describes what this launch actually
did.

Error() also prints its message outside the lookup. It used to sit
INSIDE the matched-step branch, so an unregistered name swallowed the
error text as well as the step line — a failure reported nowhere at all
unless the caller independently returned it.

Second half: displayPlain skipped any step not already complete/error,
so a RUNNING step emitted zero bytes on a non-TTY (measured) and
announced itself only once finished. Piping, capturing or CI therefore
made a long wait and a wedged process identical — backwards, since
knowing what is in flight is the whole value of progress output on a
non-interactive stream. Starts are now logged once each, and `skipped`
is reported rather than dropped.

The two longest waits state their ceiling ("up to 5 min"). A bounded
wait that says so is a wait; one that does not is a hang.

Gates confirmed to fail on revert: dropping unknown names, and skipping
running steps in displayPlain.

Also records, without fixing, five pre-existing mismatched pairs — names
passed to Complete/Error/Skip but never to Start, all in FSx/cohort
paths. Find-or-append makes those render as a second never-started step
rather than vanishing, so they are now visible; a test flags any
increase.
@scttfrdmn
scttfrdmn force-pushed the fix/739-progress-step-registration branch from ce6a3c6 to 035c645 Compare October 8, 2026 03:22
@scttfrdmn
scttfrdmn merged commit d39b75d into main Oct 8, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/739-progress-step-registration branch October 8, 2026 03:29
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.

24 of 32 progress step names are unregistered, so spawn's longest operations print nothing while they run

1 participant