{
  "id": "go/sql-max-open-connections-exceeded",
  "signature": "error: sql: connection pool exhausted",
  "signature_zh": "错误：sql：连接池耗尽",
  "regex": "error:\\ sql:\\ connection\\ pool\\ exhausted",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "连接池中的连接数达到最大值，且所有连接都在使用中。",
  "root_cause_type": "generic",
  "root_cause_zh": "连接池中的连接数达到最大值，且所有连接都在使用中。",
  "versions": [
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "数据库服务器可能过载。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "导致连接泄漏，更快耗尽。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "设置合理池大小：\ndb.SetMaxOpenConns(50)\ndb.SetMaxIdleConns(10)\ndb.SetConnMaxLifetime(time.Hour)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "确保所有连接关闭：\ndefer rows.Close()\ndefer stmt.Close()",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}