Skip to content

fix: add bounded timeout to Firecrawl RAG extractor requests - #39596

Open
SpiliosDimakopoulos wants to merge 7 commits into
langgenius:mainfrom
SpiliosDimakopoulos:fix/firecrawl-app-request-timeout
Open

fix: add bounded timeout to Firecrawl RAG extractor requests#39596
SpiliosDimakopoulos wants to merge 7 commits into
langgenius:mainfrom
SpiliosDimakopoulos:fix/firecrawl-app-request-timeout

Conversation

@SpiliosDimakopoulos

Copy link
Copy Markdown
Contributor

FirecrawlApp._post_request()/_get_request() call httpx.post()/get() with no explicit timeout inside a 502-retry loop, unlike the equivalent WaterCrawl RAG extractor client (core/rag/extractor/watercrawl/client.py), which already uses a bounded httpx.Timeout(30.0, connect=5.0). A slow or hanging Firecrawl endpoint could otherwise block the worker indefinitely during scrape/crawl/map/search requests. Adds the same bounded timeout constant and passes it to both outbound calls. Verified the 502-retry-then-success and retry-exhaustion paths are unchanged; existing tests only assert on return values/call counts, not kwargs, so no test changes were needed.

…ΘΜΟ>)

'Runing docker container' -> 'Running docker container'.
…ΘΜΟΣ>)

ar-SA: unescape the quick-start-guide link and point it at the real heading slug (#البداية-السريعة). hi-IN: point the community link at the real bilingual heading slug (#समुदाय-और-संपर्क-community--contact). Verified both slugs with github-slugger.
validate_credentials() -> _get_request() called httpx.get() with no explicit timeout, unlike the Jina/Firecrawl/Nacos/Marketplace auth providers which were recently hardened with bounded httpx.Timeout values. A slow or hanging WaterCrawl endpoint could block the worker indefinitely during credential validation.

Updated the existing unit test to assert the new timeout kwarg.
FirecrawlApp._post_request()/_get_request() called httpx.post()/get() with no explicit timeout inside a 502-retry loop, unlike the equivalent WaterCrawl RAG extractor client (core/rag/extractor/watercrawl/client.py) which already uses a bounded httpx.Timeout. A slow or hanging Firecrawl endpoint could block the worker indefinitely during scrape/crawl/map/search requests.

Verified locally that existing behavior (200 responses, 502-retry-then-success, retry exhaustion) is unchanged; no test assertions check call kwargs so no test updates were needed.
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 54.99% 54.99% +0.00%
Strict coverage 54.48% 54.48% +0.00%
Typed symbols 35,658 35,659 +1
Untyped symbols 29,460 29,460 0
Modules 3068 3068 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant