{
  "id": "go/http-response-writer-timeout",
  "signature": "http: response writer timeout: request timed out after 30s",
  "signature_zh": "http: 响应写入超时：请求在 30 秒后超时",
  "regex": "http:\\ response\\ writer\\ timeout:\\ request\\ timed\\ out\\ after\\ 30s",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The server's WriteTimeout expired while writing the response body, causing the connection to be closed abruptly.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器写入超时在写入响应体期间到期，导致连接突然关闭。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "May cause slow clients to hold connections indefinitely, leading to resource exhaustion.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Writes will fail silently; data is corrupted and the connection is already closed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Set a reasonable WriteTimeout and handle errors from Write: if _, err := w.Write(data); err != nil { return }",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.75,
      "how": "Use http.TimeoutHandler to wrap handlers and return a timeout response: http.TimeoutHandler(handler, 30*time.Second, \"timeout\")",
      "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-03-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}