Skip to content

Fix: Add timeout to SerpAPI HTTP requests#310

Open
OpenSourceSoul wants to merge 1 commit intoDesearch-ai:mainfrom
OpenSourceSoul:fix/serpapi-timeout
Open

Fix: Add timeout to SerpAPI HTTP requests#310
OpenSourceSoul wants to merge 1 commit intoDesearch-ai:mainfrom
OpenSourceSoul:fix/serpapi-timeout

Conversation

@OpenSourceSoul
Copy link
Copy Markdown

Problem

The SerpAPI wrapper makes HTTP requests without any timeout configured. If SerpAPI is slow or unresponsive, the request hangs indefinitely, blocking the validator or miner.

Solution

Added a 30-second timeout to both the ClientSession and individual GET requests. This prevents indefinite hanging while still allowing reasonable time for API responses.

Why This Matters

  • SerpAPI calls are in the critical path for web search functionality
  • A single hanging request can freeze the entire validator/miner process
  • This affects both scoring and reward computation
  • Network issues or API slowdowns should not cause complete service failure

The SerpAPI wrapper was making HTTP requests without any timeout,
which could cause the validator/miner to hang indefinitely if the
SerpAPI service is slow or unresponsive. This adds a 30-second
timeout to both ClientSession creation and individual GET requests.
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