{
  "id": "aws/lambda-snapstart-hook-timeout",
  "signature": "SnapStart hook timed out: The runtime hook did not complete within 10 seconds.",
  "signature_zh": "SnapStart 钩子超时：运行时钩子在 10 秒内未完成。",
  "regex": "SnapStart hook timed out.*did not complete within 10 seconds",
  "domain": "aws",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Lambda SnapStart initialization hook (e.g., for Java) exceeded the 10-second limit during snapshot creation.",
  "root_cause_type": "generic",
  "root_cause_zh": "Lambda SnapStart 初始化钩子（例如 Java）在快照创建期间超过了 10 秒限制。",
  "versions": [
    {
      "version": "java-21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "snapstart-1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "aws-lambda-java-core-1.2.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing Lambda timeout setting doesn't affect SnapStart hook timeout; the 10-second limit is fixed.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling SnapStart entirely removes the performance benefit and doesn't fix the root cause.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Optimize the initialization code in the `CRaC` or `beforeCheckpoint` hook: move heavy setup (e.g., DB connection pools) to lazy initialization after checkpoint.",
      "success_rate": 0.8,
      "how": "Optimize the initialization code in the `CRaC` or `beforeCheckpoint` hook: move heavy setup (e.g., DB connection pools) to lazy initialization after checkpoint.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a smaller runtime or reduce classpath scanning: in Spring Boot, set `spring.context.initializer.exclude` to skip slow beans.",
      "success_rate": 0.7,
      "how": "Use a smaller runtime or reduce classpath scanning: in Spring Boot, set `spring.context.initializer.exclude` to skip slow beans.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "优化 `CRaC` 或 `beforeCheckpoint` 钩子中的初始化代码：将重负载设置（如数据库连接池）移至检查点后的延迟初始化。",
    "使用更小的运行时或减少类路径扫描：在 Spring Boot 中设置 `spring.context.initializer.exclude` 以跳过慢速 bean。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.75,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}