SDK rpc proxy: a relayed node error does not trip the breaker - #1629
Conversation
PR Summary by QodoSDK RPC proxy: relayed node errors no longer trip the breaker
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe SDK now classifies tagged RPCERROR 502 responses separately, resets the proxy breaker for those responses, and reports their count. Tests cover breaker behavior and periodic statistics output. ChangesRPCERROR proxy handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change prevents relayed node errors from unnecessarily tripping the proxy breaker while preserving breaker behavior for actual proxy failures; no actionable merge-blocking risk remains at the current head beyond normal checks. Sequence Diagram(s)sequenceDiagram
participant Caller
participant callRPC
participant SSRProxy
participant NodeLoop
Caller->>callRPC: Request RPC data
callRPC->>SSRProxy: Send proxy request
SSRProxy-->>callRPC: 502 with X-Ssr-Cache: RPCERROR
callRPC->>callRPC: Record rpcerror and reset breaker misses
callRPC->>NodeLoop: Fall back to node requests
NodeLoop-->>Caller: Return node response
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Code Review by Qodo
1.
|
Code Review by Qodo
1. SDK dist not rebuilt
|
Closes #1628.
In production a large share of the proxy's non-200 answers are hivemind application errors relayed as
502withX-Ssr-Cache: RPCERROR(Tag <x> does not existfor crawler-made feed URLs, 5 of 30 real feed URLs replayed on one origin).callRPCcounted each as a proxy miss, so three in a row opened the breaker for 10s and every eligible read in that window skipped a healthy proxy (thousands ofskippedper replica per hour).rpcerror: a502taggedRPCERROR. The read still falls back to the node loop, so the caller gets the node's own answer as before; but the proxy reached a node and relayed it, so the relay resets the consecutive-miss count like a served call instead of advancing it. A bare502/504, transport, parse and validator misses count as before.rpcProxyStats.fallbackByReason.rpcerrorand the web's[rpc-proxy]line carry the new bucket, so real proxy failures and relayed node errors can be told apart in the logs.The SDK source change reaches the web bundle through the dist rebuild, which is label-driven.
Summary by CodeRabbit