{
  "id": "go/sql-connection-pool-exhausted",
  "signature": "sql: connection pool exhausted: too many connections",
  "signature_zh": "sql: 连接池耗尽：连接过多",
  "regex": "sql:\\ connection\\ pool\\ exhausted:\\ too\\ many\\ connections",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "More concurrent database requests than available connections; pool max limit reached.",
  "root_cause_type": "generic",
  "root_cause_zh": "并发数据库请求超过可用连接数，达到连接池最大限制。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Unlimited connections can overwhelm database server.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "May not be feasible; pool still limited.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use connection pooling with SetMaxOpenConns and SetMaxIdleConns, and use context timeouts: db.SetMaxOpenConns(10); db.SetConnMaxLifetime(time.Minute)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Implement a semaphore to limit concurrent queries: sem := make(chan struct{}, 10); sem <- struct{}{}; defer func(){<-sem}()",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}