Repository navigation
fix(wedge): widen wedge budget + dedupe shutdown log under burst link load (#726) - #727
Merged
Merged
Conversation
… load (#726) Two related fixes for the FastLED `all-with-examples` burst-link scenario: 1. `WEDGE_RECV_DEFAULT_SECS` 90s -> 180s. The 90s ceiling tripped for healthy daemons that were simply bottlenecked behind ~341 concurrent link TUs (#726 daemon log evidence: graceful-shutdown fired exactly at uptime_secs=120, dead in the middle of active compile/link work). 180s preserves wedge detection (real wedges show up as recv stalls measured in minutes; #666/#724 patterns) while leaving headroom for legitimate burst link loads on a busy daemon. `ZCCACHE_WEDGE_RECV_TIMEOUT_SECS` override still works; setting it to 0 still restores the pre-#666 300s behavior. 2. Dedupe `died-shutdown` lifecycle writes. When many wedge-detecting clients raced to send `Request::Shutdown` within ~15 ms, each connection handler wrote the same `died-shutdown` row, producing 25+ duplicate entries for a single daemon death in production logs. Now gated by a CAS on a new `shutdown_event_logged: AtomicBool` on `SharedState` so only the first Shutdown handler writes. Bumps workspace to 1.12.2 so release-auto.yml ships the fix on merge. Refs #726. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Jun 14, 2026
zackees
added a commit
that referenced
this pull request
Jun 14, 2026
…733) Adds `crates/zccache/tests/daemon_burst_link_test.rs` so the #726 wedge class is regression-testable without depending on FastLED on a runner. Two tests: - `burst_compile_does_not_wedge_daemon` (#[ignore], integration): fires N=200 concurrent `Request::Compile` invocations against a single fresh DaemonServer. Asserts all complete, the daemon answers a follow-up Ping on a fresh connection, and the wall time stays under the 60 s budget from #729. Verified locally: N=50 → 5.8 s, N=200 → 26.0 s. Tunable via `ZCCACHE_BURST_N`. No-ops when clang is not on PATH, matching the existing `daemon_stress_test.rs` pattern, so it joins the standard integration suite. - `wedge_budget_default_survives_burst_window`: documents the invariant the burst test relies on — the default wedge recv budget (#727's 90 s → 180 s widening) must stay ≥ 150 s, otherwise the burst test will flake on slow runners. Probes the env-var contract (`ZCCACHE_WEDGE_RECV_TIMEOUT_SECS`) rather than the private constant. This test catches **daemon-side** regressions that would cause the wedge guard to fire. The guard's own CLI-side logic is still covered by the `wedge_detection_*` unit tests in `crates/zccache/src/cli/commands/wrap/ipc.rs`. Closes #729. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
2 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related fixes for the FastLED
all-with-examplesburst-link scenario surfaced in #726:1.
WEDGE_RECV_DEFAULT_SECS90s -> 180sThe 90s ceiling tripped for healthy daemons that were simply bottlenecked behind a burst of concurrent link TUs. Daemon log evidence in #726:
died-shutdown reason=graceful-shutdown uptime_secs=120fired in the middle of active compile/link work, killed by the client wedge guard viaRequest::Shutdown— not a true wedge, just a slow recv on a busy daemon. 180s preserves wedge detection for real failures (#666/#724 patterns show stalls measured in minutes) while leaving headroom for legitimate burst link loads.ZCCACHE_WEDGE_RECV_TIMEOUT_SECSoverride still works; setting it to0still restores the pre-#666 300s behavior.2. Dedupe
died-shutdownlifecycle writesUnder the same burst, many wedge-detecting clients raced to send
Request::Shutdownwithin ~15 ms. Each connection handler wrote the samedied-shutdownrow, producing 25+ duplicate entries for a single daemon death in production logs. Now gated by CAS on a newshutdown_event_logged: AtomicBoolonSharedStateso only the first Shutdown handler writes.Bumps workspace to 1.12.2 so
release-auto.ymlships the fix on merge.What's deliberately not in this PR
persist_workers_default()currently hardcoded to 8). User asked about-j auto; this is the right answer but the existing comment cites a measured wall-clock regression on raising it without other changes (tests/persist_pool_bench.rs). PERF.md requires perf changes to go throughperf-rust-cluster— deferring to a follow-up.failed to persist artifact output: os error 2investigation (Daemon graceful-shutdown under burst link load: FastLEDall-with-examples(~341 concurrent linker invocations) trips wedge guard + spawn storm + stale-DLL false test failures #726 proposal item 2). Needs a separate diagnostic-path PR with source-path + stat-retry on the WARN.Test plan
soldr cargo fmt --allsoldr cargo clippy -p zccache --lib --tests -- -D warnings— cleansoldr cargo test -p zccache --lib wedge— all 4 wedge tests pass (wedge_detection_*)soldr cargo build -p zccache --bins)swappattern — first caller observesfalse, all subsequent observetrueRefs #726.
🤖 Generated with Claude Code