Repository navigation
Recover stale Redis connections and isolate Gemini timeouts - #9533
Conversation
Parenthesize reconnect jitter so -D warnings clippy passes in CI, and label missing Redis as not_configured instead of auth_config. Co-authored-by: Cursor <[email protected]>
Missing vertex_auth is steady-state AI Studio routing at boot, not a mid-request heal. Keep record_fallback only for Vertex token failure (reason=auth). Co-authored-by: Cursor <[email protected]>
|
@cursor resolve merge conflicts |
|
Merge conflicts are resolved and pushed to Conflicts resolvedTwo files conflicted when merging
Verificationcd desktop/macos/Backend-Rust && cargo test --locked
# 348 passedThe merge commit is on the branch: |
Resolve conflicts in Backend-Rust by keeping the PR's generation-aware Redis recovery owner and the 75s Gemini end-to-end deadline model. Verification: cd desktop/macos/Backend-Rust && cargo test --locked (348 passed) Co-authored-by: David Zhang <[email protected]>
|
@cursor address merge conflicts |
|
Merge conflicts are resolved and pushed to What conflicted
Resolution
Verificationcd desktop/macos/Backend-Rust && cargo test --locked
# 339 passed |
Resolve conflicts by keeping generation-aware Redis recovery and fail-closed metering while adopting main's dormant-data-plane deletion and pub(crate) visibility lint. Restore encryption_secret config loading dropped in the merge. Verification: cd desktop/macos/Backend-Rust && cargo test --locked (339 passed) Co-authored-by: David Zhang <[email protected]>


Summary
/readywithout removing Redis-independent traffic from Kubernetes service readinessAddresses #9524.
Root cause and recurrence
The Rust backend cached one multiplexed Redis connection for the process lifetime. A broken pipe was returned to the caller, but no owner invalidated that connection, so every later metered request reused the stale generation until process restart. The same owner also allowed concurrent cold-start connections.
The Gemini timeout class recurred after #8640 and #8911 because those fixes only moved a per-attempt timeout to the current infrastructure boundary. Token acquisition, provider fallback, dispatch, and body drain did not share one logical deadline, and timeout outcomes were not separated from auth or generic provider failures.
Durable guard
Verification
cd desktop/macos && bash test.sh— launcher checks passed, Rust suite passed, and 237 Swift suites passed in isolationcd desktop/macos/Backend-Rust && cargo test --locked— 346 passedcd desktop/macos/Backend-Rust && cargo check --locked— passedcd desktop/macos/Backend-Rust && cargo fmt -- --check— passedmake preflight— all 9 selected manifest checks passed; no locked product invariants applyThe fault tests exercise the production Redis client against scripted RESP sockets: first-command connection close, safe replay recovery, non-replayable EVAL, eight concurrent stale callers, reconnect exhaustion, repeated stale generations, and auth/config rejection. Gemini tests exercise a hanging local upstream plus a real Axum HTTP downstream disconnect, proving the upstream request is dropped without detached work.
Rollout notes
No production mutation is included in this PR. After deployment, verify the exact revision with a controlled Redis connection close, authenticated managed-key TTS, and a natural-traffic window longer than the prior short soak. Roll back on retry amplification, duplicate metering, or a new TTS failure cluster.
The repository does not own the external release-health dashboard/alert consumer. This PR supplies bounded
gemini_provider_requestoutcomes so #9523 can exclude provider timeouts from release-regression aggregation while continuing to report the provider SLO separately.