{
  "id": "api/rate-limit-connection-pool-exhausted",
  "signature": "503 Service Unavailable: Connection pool exhausted. Maximum connections to backend reached.",
  "signature_zh": "503 服务不可用：连接池已耗尽。到达后端最大连接数。",
  "regex": "503.*connection pool exhausted",
  "domain": "api",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Client-side HTTP connection pool (e.g., requests.Session or Node.js http.Agent) has no available connections due to slow responses or leaks.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端HTTP连接池（如requests.Session或Node.js http.Agent）因慢响应或泄漏而无可用连接。",
  "versions": [
    {
      "version": "Python requests 2.31.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Node.js http module 18.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go net/http 1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing max_connections arbitrarily without addressing slow backend responses leads to memory exhaustion and worse performance.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Restarting the application without adjusting timeout settings causes the pool to exhaust again quickly under load.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase connection pool size and add idle timeout. In Python requests: session = requests.Session(); adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100, max_retries=3); session.mount('https://', adapter); session.mount('http://', adapter)",
      "success_rate": 0.8,
      "how": "Increase connection pool size and add idle timeout. In Python requests: session = requests.Session(); adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100, max_retries=3); session.mount('https://', adapter); session.mount('http://', adapter)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable connection reuse with keepalive and reduce request timeout. For Node.js: const agent = new http.Agent({ keepAlive: true, maxSockets: 25, timeout: 60000 });",
      "success_rate": 0.75,
      "how": "Enable connection reuse with keepalive and reduce request timeout. For Node.js: const agent = new http.Agent({ keepAlive: true, maxSockets: 25, timeout: 60000 });",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add retry with exponential backoff for 503 errors to allow connections to be released.",
      "success_rate": 0.7,
      "how": "Add retry with exponential backoff for 503 errors to allow connections to be released.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase connection pool size and add idle timeout. In Python requests: session = requests.Session(); adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100, max_retries=3); session.mount('https://', adapter); session.mount('http://', adapter)",
    "Enable connection reuse with keepalive and reduce request timeout. For Node.js: const agent = new http.Agent({ keepAlive: true, maxSockets: 25, timeout: 60000 });",
    "Add retry with exponential backoff for 503 errors to allow connections to be released."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.python-requests.org/en/latest/user/advanced/#transport-adapters",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.78,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}