Skip to content

fix(cli): say why the daemon never became healthy (#1627) - #1732

Merged
zackees merged 1 commit into
mainfrom
fix/1627-daemon-startup-reason
Oct 25, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/1627-daemon-startup-reason

Conversation

@zackees

@zackees zackees commented Oct 25, 2026

Copy link
Copy Markdown
Member

Refs #1627. This implements ask 1: log the reason each spawn attempt failed.

Change

daemon did not become healthy after 3 spawn attempts named no cause. The daemon already writes one to daemon.log: a bind collision, root-owner lock busy, a panic. The CLI now quotes those lines in the error.

  • New daemon_client/startup_log.rs:
    • records a UTC timestamp, in tracing's own format, just before the first spawn attempt
    • reads daemon.log after the attempts fail
    • strips ANSI colour, keeps WARN/ERROR lines at or after that timestamp, and appends the last 8
  • Lines from earlier daemon runs are excluded by the timestamp. If the log is missing or holds nothing relevant, the error is unchanged.
  • This is a new file because daemon_client.rs is already over the LOC gate.

Verification

  • Unit tests. Timestamp format matches tracing, old-run and INFO lines are dropped, colour is stripped, and output is capped at 8 lines.
  • Real failure. I bound the daemon's port (127.0.0.1:11393) with a socket that never listens, then ran fbuild build tests/platform/uno -e uno. It exits 1, and the error now ends with:
    The daemon logged these problems during the spawn attempts (~/.fbuild/dev/daemon/daemon.log):
      … WARN fbuild_daemon: bind to 127.0.0.1:11393 failed (Address already in use (os error 98)); no listener present, … retrying in 500ms attempt=1
      …
    
  • Checks. Workspace clippy with -D warnings is clean, the fbuild-cli tests pass, and the platform-boundary inventory check passes.

Not covered

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8088892 and 738ae38.

Files selected for processing: 3
  • crates/fbuild-cli/src/daemon_client.rs
  • crates/fbuild-cli/src/daemon_client/README.md
  • crates/fbuild-cli/src/daemon_client/startup_log.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

'daemon did not become healthy after 3 spawn attempts' gave no cause, so CI
flakes were undiagnosable. The daemon already logs the reason (bind collision,
cache-root ownership busy, ...) to daemon.log; the CLI now quotes the WARN and
ERROR lines it wrote during this CLI's spawn attempts in that error.
@zackees
zackees force-pushed the fix/1627-daemon-startup-reason branch from 1166f13 to 738ae38 Compare October 25, 2026 05:47
@zackees
zackees merged commit 2bf95d7 into main Oct 25, 2026
24 checks passed
@zackees
zackees deleted the fix/1627-daemon-startup-reason branch October 25, 2026 05:55
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant