{
  "id": "go/database-sql-connection-pool-exhausted",
  "signature": "error: database/sql: connection pool exhausted: too many connections",
  "signature_zh": "错误：数据库连接池耗尽：连接过多",
  "regex": "error:\\ database/sql:\\ connection\\ pool\\ exhausted:\\ too\\ many\\ connections",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "数据库连接池中的连接数量达到上限，无法创建新连接。",
  "root_cause_type": "generic",
  "root_cause_zh": "数据库连接池中的连接数量达到上限，无法创建新连接。",
  "versions": [
    {
      "version": "1.18",
      "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.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "db.SetMaxOpenConns(100)\ndb.SetMaxIdleConns(50)\ndb.SetConnMaxLifetime(time.Hour)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "defer rows.Close()\ndefer stmt.Close()\ndefer db.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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}