Skip to content

Retry transient Ponder GraphQL network errors - #64

Merged
Danswar merged 1 commit into
developfrom
fix/apollo-retry-transient-network-errors
Jul 24, 2026
Merged

Retry transient Ponder GraphQL network errors#64
Danswar merged 1 commit into
developfrom
fix/apollo-retry-transient-network-errors

Conversation

@Danswar

@Danswar Danswar commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • The position sync job's GetPositionsV2 query occasionally fails with a "Premature close" network error against the indexer's GraphQL endpoint — consistent with a stale keep-alive socket getting reused right as the server closes it.
  • There was no retry for this case: errorLink only retries by switching to a fallback URL when one is configured, otherwise the failure goes straight through.
  • Adds an Apollo RetryLink ahead of the HTTP link so transport-level failures get a few short, jittered retries (max 3, 200ms–2s backoff) before reaching the existing error/fallback handling. GraphQL-level errors (a successful response with errors in it) are unaffected — only network/transport failures are retried.

Test plan

  • nest build passes
  • eslint / prettier clean on the changed file
  • Confirm in the deployed environment that this error signature stops recurring

The GetPositionsV2 sync job occasionally sees a "Premature close" from
the indexer, consistent with a stale keep-alive socket being reused
right as it's closed server-side. There was no retry for this case:
network errors that couldn't fall back landed straight in the logs.

Adds a RetryLink ahead of the HTTP link so transport-level failures
get a few short, jittered retries before reaching the error/fallback
handling. GraphQL-level errors are unaffected.
@Danswar
Danswar marked this pull request as ready for review July 24, 2026 18:54
@Danswar
Danswar requested a review from TaprootFreak as a code owner July 24, 2026 18:54
@Danswar
Danswar merged commit a68b77a into develop Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant