Skip to content

perf(daemon): FBUILD_WATCH_SET_CACHE_SECS env override#126

Merged
zackees merged 1 commit intomainfrom
perf/watch-set-cache-env-override
Apr 19, 2026
Merged

perf(daemon): FBUILD_WATCH_SET_CACHE_SECS env override#126
zackees merged 1 commit intomainfrom
perf/watch-set-cache-env-override

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 19, 2026

Summary

Closes #122. Lets an operator tune or disable the watch-set fingerprint cache (from #120) at daemon startup without a rebuild, mirroring the FBUILD_SELF_EVICTION_SECS pattern from #116.

Semantics

FBUILD_WATCH_SET_CACHE_SECS Effect
unset / unparseable 2 s (default)
positive integer that many seconds
`0` `Duration::ZERO` — every `put` is stale on store, `get` always returns `None` (cache disabled)
whitespace around digits parsed after trim

Zero-secs uses the existing with_max_age API — no new `Option<>` on DaemonContext, the cache-module surface stays focused on caching and the env-coupling lives next to the sibling self_eviction_timeout() reader in `context.rs`.

Tests

One exhaustive table-driven test in `context::tests`: covers unset, zero, positive, garbage, and whitespace cases; saves + restores prior env so parallel test isolation is preserved. Full daemon lib tests 126 pass; cargo clippy --workspace --all-targets -- -D warnings clean.

Related: #120 (the cache), #116 (same pattern for self-eviction).

🤖 Generated with Claude Code

Lets an operator tune or disable the watch-set fingerprint cache
(landed in #120) at daemon startup without a rebuild.

- Unset / unparseable → 2 s default.
- Positive integer → that many seconds.
- `0` → `Duration::ZERO`: every `put` is stale the instant it's
  stored, so `get` always returns `None`. Effectively disables the
  cache — useful for A/B-ing a suspected regression without changing
  code or toggling a feature flag.

Implemented as a small helper `watch_set_cache_window_from_env()`
next to the existing `self_eviction_timeout()` env reader
(mirrors #116's `FBUILD_SELF_EVICTION_SECS` pattern). No changes
to `DaemonWatchSetCache`'s own surface — keeps the cache module
focused on caching, the env-coupling where it belongs.

Exhaustive table-driven unit test covers all five parse cases
(unset, zero, positive, garbage, whitespace).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 53 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 53 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 02cf02ef-54a5-4464-93ac-38d7d7b7b561

📥 Commits

Reviewing files that changed from the base of the PR and between d0935d5 and 2e90033.

📒 Files selected for processing (1)
  • crates/fbuild-daemon/src/context.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/watch-set-cache-env-override

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 and usage tips.

@zackees zackees merged commit 82468b7 into main Apr 19, 2026
6 of 77 checks passed
@zackees zackees deleted the perf/watch-set-cache-env-override branch April 19, 2026 02:56
zackees added a commit that referenced this pull request Apr 19, 2026
Cuts a release containing the two P0 fixes landed since 2.1.19:

- #134 "P0 regression — Operation not permitted (os error 1) on warm build"
- #135 "preserve exec bit on fbuild console script in wheel"

Both are currently blocking every FastLED uno build on GitHub Actions:
the wheel's console script installs without +x, so CI can't even run
`fbuild --version`, and the subsequent compile fails with
`Operation not permitted (os error 1)` on every example.

Also includes:

- #131 rustfmt on lnk pipeline
- #133 DiskCache leases.refcount schema migration
- #128 AVR orchestrator fingerprint fast-path + telemetry (#127)
- #126 FBUILD_WATCH_SET_CACHE_SECS env override
- f8533d3 extend watch-set fingerprint fast-path to AVR orchestrator

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zackees added a commit that referenced this pull request Apr 19, 2026
Cuts a release containing the two P0 fixes landed since 2.1.19:

- #134 "P0 regression — Operation not permitted (os error 1) on warm build"
- #135 "preserve exec bit on fbuild console script in wheel"

Both are currently blocking every FastLED uno build on GitHub Actions:
the wheel's console script installs without +x, so CI can't even run
`fbuild --version`, and the subsequent compile fails with
`Operation not permitted (os error 1)` on every example.

Also includes:

- #131 rustfmt on lnk pipeline
- #133 DiskCache leases.refcount schema migration
- #128 AVR orchestrator fingerprint fast-path + telemetry (#127)
- #126 FBUILD_WATCH_SET_CACHE_SECS env override
- f8533d3 extend watch-set fingerprint fast-path to AVR orchestrator

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

perf: expose FBUILD_WATCH_SET_CACHE_SECS env override for the watch-set cache window

1 participant