fix: track Ponder fallback routing as a flag, not a URL comparison - #62
Closed
Danswar wants to merge 1 commit into
Closed
fix: track Ponder fallback routing as a flag, not a URL comparison#62Danswar wants to merge 1 commit into
Danswar wants to merge 1 commit into
Conversation
Ported from d-EURO#123. sentToFallback compared the request's targetUrl against CONFIG.indexerFallback by string value. Our compose files (dfxprd + dfxdev) set CONFIG_INDEXER_FALLBACK_URL to the same host as CONFIG_INDEXER_URL — the only way to keep the var populated without cross-environment failover. With primary and fallback string-identical, the comparison is true on every request regardless of which URL it actually went to, so the warn+retry branch never fires and every network error still falls through to logger.error. Stamp the routing decision itself (isFallbackActive() at send time) instead of re-deriving it from a URL string.
2 tasks
Author
|
Superseded by #63 — rebuilt on a fresh branch to fix the PR body/commit message referencing internal infra details that shouldn't be in a public repo. Same fix, same file. |
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
Ports d-EURO#123 (same
api.apollo.config.ts, forked codebase).errorLinkdecided whether a failed Ponder request already went to the fallback by comparingoperation.getContext().targetUrlagainstCONFIG.indexerFallbackas strings.CONFIG_INDEXER_FALLBACK_URLto the same host asCONFIG_INDEXER_URLon both dfxprd and dfxdev (the only way to keep the var populated without leaking prd traffic onto dev). With primary and fallback string-identical, the comparison is true on every request regardless of which URL it actually went to, so thewarn+ retry branch could never execute — every network error would still fall through tologger.error, making #869 alone insufficient to fix the noisy error-level logging observed in Grafana forjuicedollar-jdm-api.routingLinknow stampsusedFallback: isFallbackActive()at send time, anderrorLinkreads that flag instead of re-deriving it from a URL comparison.Test plan
juicedollar-jdm-apiApiApolloConfignetwork-error lines to move fromerrortowarnon the next transient Ponder blip.