fix(rpc-client): treat Cloudflare 5xx (521-524) as retryable connection errors#520
Open
elina-chertova wants to merge 1 commit into
Open
fix(rpc-client): treat Cloudflare 5xx (521-524) as retryable connection errors#520elina-chertova wants to merge 1 commit into
elina-chertova wants to merge 1 commit into
Conversation
…on errors A transient Cloudflare-origin 522 from the sole SVM-BNB endpoint crashed the dumper (exit 1) because RpcClient.isConnectionError recognized 408/429/502/503/504 as retryable but not 521-524. The 522 was classified fatal and thrown, whereas the http-client's own isRetryableError already treats 521-524 as retryable. Add them so transient upstream Cloudflare errors are backed off and retried instead of crashing the stream. Complements #509 (worker-thread error serialization).
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.
Problem
The
svm-bnb_No_Dumper_Dataalert fired:dump-svm-bnb-0(nssolana-archive) crash-looped (exit 1) withcall failed with unserializable errororiginating from a transient Cloudflare522returned by the sole endpointrpc.svmbnbmainnet.soo.network.Root cause is in
RpcClient.isConnectionError(util/rpc-client/src/client.ts): it classifies408/429/502/503/504as retryable connection errors but omits Cloudflare-origin521-524— even though@subsquid/http-client's ownisRetryableErroralready treats521-524as retryable. A522is therefore classified fatal, thrown out of the worker-thread stream, and crashes the dumper (the opaqueunserializable erroris the error then failing structured-clone at the worker boundary).429is in the set, so the post-restart pod stalls-and-retries rather than crashing.Fix
Add
521/522/523/524to the retryable-status switch inisConnectionError, so a transient Cloudflare 5xx is backed off and retried in-worker instead of escaping as fatal.Relationship to #509
Complementary, not duplicate. This PR stops a
522before it escapes the worker (retried in-place). #509 hardensserializeErrorso any error that does escape the worker boundary is delivered as a classifiable error rather than an opaqueunserializable error. Both are needed for full defence-in-depth; this PR is the primary fix for the observed522crash.Test
Adds
util/rpc-client/src/client.test.ts— unit-testsisConnectionErroracross statuses (RED before fix on 521-524, GREEN after).vitest --run: 3/3 passing. Rush change file added;rush updatelockfile churn verified deterministic/CI-consistent.Operational follow-up (escalate)
The endpoint is up + archival (direct probe: HTTP 200, slot 74143670; burst of 10 concurrent full-block reqs all 200), but the dumper's client is being
429-throttled specifically (requests_served_total= 0 for 3h+). The code fix stops the crash-loop but does not restore throughput — the singlerpc.svmbnbmainnet.soo.networkendpoint (stride_concurrency: 10, no rate limit configured) needs a provider-side rate-limit / additional endpoint. Escalate to the infra/provider owner.