Fail over on malformed 200 responses from Hive RPC nodes#57
Conversation
A node can return 200 with valid JSON carrying neither an error nor a usable result. That response was recorded as a success, so the health tracker kept the misbehaving node ranked first while every dependent call (token validation, account/global-props fetches) failed for the whole window — observed twice as multi-hour bursts of 401s on authenticated endpoints. Call() now takes an optional result-shape validator; the typed helpers require an array from get_accounts and an object from get_dynamic_global_properties. A failed check marks the node failed and advances immediately, and the surfaced error names the node, which the previous 'result is not iterable' message could not.
|
Warning Review limit reached
Next review available in: 56 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
A Hive RPC node can return 200 with valid JSON that carries neither an
errorfield nor a usableresult.HiveRpcClienttreated any 200-JSON without anerrorfield as a success, so the health tracker kept such a node ranked first — a poisoned node stayed the preferred node for as long as it misbehaved. Observed twice in production as multi-hour bursts ofgetAccounts result is not iterable(~1.8k occurrences each), during which token validation failed and authenticated endpoints returned 401 to normal user traffic.This is the same malformed-200 class #56 fixed on the Hive-Engine side, now applied to the Hive JSON-RPC client.
Changes
Call()accepts an optional result-shape validator. A failed check throws the internal node-unavailable path: the node is marked failed, the pool advances immediately (no same-node retry — a node serving malformed 200s keeps serving them), and the next node is tried.get_accountsmust yield an array,get_dynamic_global_propertiesan object. All production call sites go through these two helpers.result is not iterablemessage could not say which node misbehaved.errorfield present) still surface immediately without failover, unchanged.Testing
portfolio-v2returns full hive + engine layers across repeated calls (exercises both validated helpers through HiveExplorer).