Warn on daemon identity mismatches - #1006
Conversation
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
…1009) (#1020) Follow-up to #940/#1006 (which only *warned* on daemon identity mismatch). Two fixes so a wrong-version daemon can no longer silently serve another checkout's builds: 1. **Endpoint keyed by version + cache-identity.** `get_daemon_port()`'s default was a fixed per-user port (8765/8865) shared by every checkout. Now the endpoint is derived from `daemon_endpoint_key()` = FNV-1a of `CARGO_PKG_VERSION | DaemonCacheIdentity.label_value()`: `default_daemon_port()` maps it into the IANA dynamic range (49152–65535), and the port file is named `daemon-<key>.port`. Since fbuild-paths is workspace-versioned, the CLI and daemon derive the same key with no handshake — daemons of different versions land on distinct ports/files and can't serve each other; same-version+cache checkouts still (correctly) share. Dropped the old cross-mode port fallback (an anti-isolation bridge). `FBUILD_DAEMON_PORT` still overrides. 2. **Version arbitration, not mtime.** `ensure_direct_daemon_running` used `cli_binary_mtime > daemon_source_mtime` to decide restarts, so a freshly-built *older* binary (newer mtime) could evict a *newer* daemon. New pure `should_restart_daemon(cli_ver, daemon_ver, cli_mtime, daemon_mtime)`: restart iff the CLI is a newer semver (upgrade) or the same version was rebuilt (mtime); **never** evict a newer daemon. `HealthResponse.version` was already on the wire. Tests: fbuild-paths endpoint-key/port derivation (deterministic, ranged, version -distinct, keyed port file); fbuild-cli arbitration matrix (older-never-evicts, newer-upgrades, same-version-mtime, unparseable-fallback). CLAUDE.md port docs updated. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
/api/daemon/infobefore daemon-backed build/deploy/monitor/test-emu requestsCloses #940
Scope note
This intentionally avoids changing default daemon port derivation. The low-risk slice makes cross-checkout collisions visible before the request is served by the wrong daemon; per-checkout endpoint isolation remains a broader behavior change.
Local validation
soldr cargo fmt --all --checksoldr --no-cache cargo test -p fbuild-cli daemon_identity_warning-> 5 passedsoldr --no-cache cargo check -p fbuild-cli --all-targetssoldr --no-cache cargo clippy -p fbuild-cli --all-targets -- -D warnings-> exit 0; repo still emits the existing clippy/Cargo MSRV config warninggit diff --checkNormal
soldr cargo test -p fbuild-cli daemon_identity_warningfailed before running tests in soldr's embedded compile dispatch (early eof), so the validation usedsoldr --no-cacheto bypass that local cache layer.