Skip to content

fix(console): stop the dashboard before the shutdown message is drawn - #375

Merged
Bugs5382 merged 1 commit into
mainfrom
fix/370-shutdown-redraw
Oct 14, 2026
Merged

Bugs5382 merged 1 commit into
mainfrom
fix/370-shutdown-redraw

Conversation

@Bugs5382

Copy link
Copy Markdown
Contributor

What and why

Since #366 the console shows a branded "Rebooting..." or "Shutting down..."
message as soon as a shutdown is chosen. The dashboard is a separate
supervised process (cmd/cryptos-console) writing to the same /dev/console
on its own refresh tick, and nothing told it to stop, so a tick landing after
the message was written could redraw the ordinary status frame over it (or
mix the two) until the screen went dark.

shutdownRequests.Wait now stops the console dashboard, and waits for it to
have actually exited, before announcing the shutdown message, so no dashboard
frame can land after it. run.go wires this by giving the console supervisor
its own cancelable context instead of sharing the node's: canceling it kills
the running cryptos-console child and stops the supervisor from relaunching
it, and stopConsole blocks until that has happened.

No docs change: the README already describes the branded screen as the
intended behavior; this fixes a race that could violate it, not the described
behavior itself.

Refs #370

Verification

  • Lint clean
  • Tests pass
  • Build succeeds
  • Documentation updated (if behavior or API changed) -- not needed, see above

How this was verified

  • go build ./...
  • systemd-run --user --scope -q -p MemoryMax=6G -p MemorySwapMax=0 go test ./... (all packages pass)
  • golangci-lint run ./internal/init/... (0 issues)
  • gofmt -l . (clean)
  • New test TestShutdownRequests_WaitStopsTheConsoleBeforeAnnouncing fails without the fix
    (stopConsole undefined, then wrong call order) and passes with it, asserting stopConsole runs
    before announce.

Since #366 the console shows a branded "Rebooting..." or "Shutting
down..." message as soon as a shutdown is chosen. The dashboard is a
separate supervised process writing to the same console on its own
refresh tick, and nothing told it to stop, so a tick landing after the
message was written could redraw the ordinary status frame over it.

Wait now stops the console dashboard, and waits for it to have
actually exited, before announcing the shutdown message, so no
dashboard frame can land after it.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382
Bugs5382 marked this pull request as ready for review October 14, 2026 15:08
@github-actions github-actions Bot added the fix Bug fix (fix). Patch. label Oct 14, 2026
@Bugs5382

Copy link
Copy Markdown
Contributor Author

Approved. The dashboard stops before the shutdown message is drawn. Refs #370

@Bugs5382
Bugs5382 merged commit 41634f9 into main Oct 14, 2026
27 checks passed
@Bugs5382
Bugs5382 deleted the fix/370-shutdown-redraw branch October 14, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix (fix). Patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant