{
  "id": "data/mongodb-connection-pool-exhausted",
  "signature": "MongoError: connection pool exhausted",
  "signature_zh": "MongoError：连接池耗尽",
  "regex": "MongoError:\\s*connection pool exhausted",
  "domain": "data",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "All connections in the MongoDB driver's connection pool are in use and no new connections can be created, typically due to slow queries or insufficient pool size.",
  "root_cause_type": "generic",
  "root_cause_zh": "MongoDB 驱动程序的连接池中的所有连接都已被占用，无法创建新连接，通常是由于查询缓慢或池大小不足导致。",
  "versions": [
    {
      "version": "MongoDB 5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MongoDB 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MongoDB 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Node.js driver 4.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "More connections increase contention and memory usage on the server, causing slower queries and more timeouts.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The root cause (slow queries or insufficient indexing) remains unaddressed.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Timeouts may kill slow queries but don't fix the underlying performance issue, leading to data inconsistency.",
      "fail_rate": 0.55,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase maxPoolSize and add connection pooling monitoring to detect slow operations. In Node.js: `const client = new MongoClient(uri, { maxPoolSize: 100 });`",
      "success_rate": 0.75,
      "how": "Increase maxPoolSize and add connection pooling monitoring to detect slow operations. In Node.js: `const client = new MongoClient(uri, { maxPoolSize: 100 });`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Optimize slow queries by adding indexes and using explain() to identify full collection scans. Example: `db.collection.createIndex({ field: 1 });`",
      "success_rate": 0.85,
      "how": "Optimize slow queries by adding indexes and using explain() to identify full collection scans. Example: `db.collection.createIndex({ field: 1 });`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement connection pool draining and retry logic in application code to gracefully handle transient exhaustion.",
      "success_rate": 0.7,
      "how": "Implement connection pool draining and retry logic in application code to gracefully handle transient exhaustion.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase maxPoolSize and add connection pooling monitoring to detect slow operations. In Node.js: `const client = new MongoClient(uri, { maxPoolSize: 100 });`",
    "Optimize slow queries by adding indexes and using explain() to identify full collection scans. Example: `db.collection.createIndex({ field: 1 });`",
    "Implement connection pool draining and retry logic in application code to gracefully handle transient exhaustion."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/drivers/node/current/connection-pool-monitoring/",
  "official_doc_section": null,
  "error_code": "MongoError",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}