Skip to content

fix: retry transient failures when fetching the docs index source - #121

Merged
ChiragAgg5k merged 3 commits into
mainfrom
fix/docs-fetch-retry
Sep 13, 2026
Merged

ChiragAgg5k merged 3 commits into
mainfrom
fix/docs-fetch-retry

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Why

The daily Docs workflow (run 34728251207) and the integration job on main (run 34774829942) both failed on 2026-09-13 with an httpx.ConnectError raised during the TLS handshake of one page fetch against appwrite.io. A full index build issues one request per manifest entry (684 today), and fetch_page had no retry, so a single transient failure aborted the whole rebuild. The CI rerun passed and the full fetch completes cleanly locally, which confirms the failure is transient.

What

  • Add get_with_retry in docs_source.py, used by both the manifest fetch and every page fetch.
  • Retry httpx.TransportError (connect, read, protocol errors) and 429/500/502/503/504 responses up to 4 attempts with exponential backoff starting at 0.5s.
  • 404 and every other status are returned immediately, so unpublished pages still skip without delay and non-retryable errors still surface through raise_for_status.

Validation

  • ruff check, black --check, pyright clean.
  • 258 unit tests pass.

A full index build issues one request per manifest entry, and a single transient TLS or overload failure aborted the whole build. The daily Docs workflow and the integration job on main both failed this way on 2026-09-13. Transport errors and 429/5xx responses are now retried with exponential backoff.
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding correctness or repository-rule violations.

Summary

  • Honors bounded Retry-After values and applies jittered exponential fallback delays.
  • Treats non-finite Retry-After values such as NaN and infinity as malformed.
  • Preserves immediate handling of non-retryable responses, including 404 pages.

Reviews (3) · Last reviewed commit: "fix: reject non-finite Retry-After value..."

Comment thread src/mcp_server_appwrite/docs_source.py Outdated
Comment thread src/mcp_server_appwrite/docs_source.py Outdated
Concurrent page fetches retried in lockstep with a fixed schedule and ignored a server-requested delay. A Retry-After header now wins, capped at 30 seconds, and the fallback backoff uses full jitter.
Comment thread src/mcp_server_appwrite/docs_source.py
@ChiragAgg5k
ChiragAgg5k merged commit 3697640 into main Sep 13, 2026
5 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/docs-fetch-retry branch September 13, 2026 18:56
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