python.http_timeout
Stability
High
Detects HTTP requests without timeout configuration.
Why It Matters
Section titled “Why It Matters”Missing HTTP timeouts:
- Requests hang forever — No timeout means indefinite wait
- Resource exhaustion — Connections never released
- Cascading failures — One slow service blocks everything
Example
Section titled “Example”# ❌ Before (no timeout)import httpx
async def fetch_data(): async with httpx.AsyncClient() as client: return await client.get(url) # No timeout!# ✅ After (with timeout)import httpx
async def fetch_data(): async with httpx.AsyncClient(timeout=30.0) as client: return await client.get(url)
# Or per-request timeout:async def fetch_data(): async with httpx.AsyncClient() as client: return await client.get(url, timeout=httpx.Timeout(30.0))What Unfault Detects
Section titled “What Unfault Detects”- HTTP clients without timeout parameter
- Per-request calls without timeout
- Very long timeout values