{
  "id": "grpc/write-deadline-exceeded-on-stream",
  "signature": "DEADLINE_EXCEEDED: grpc: write deadline exceeded on stream 456 after 10000ms",
  "signature_zh": "DEADLINE_EXCEEDED: grpc: 流 456 上的写入超时，超过 10000ms",
  "regex": "DEADLINE_EXCEEDED: grpc: write deadline exceeded on stream \\d+ after \\d+ms",
  "domain": "grpc",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The server took too long to write data to the stream, exceeding the configured write deadline, often due to slow network or blocked I/O.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器写入数据到流的时间过长，超过了配置的写入超时，通常由于网络缓慢或 I/O 阻塞。",
  "versions": [
    {
      "version": "gRPC C++ 1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Core 1.61.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Ruby 1.62.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the overall RPC deadline only, ignoring write deadline",
      "why_fails": "Write deadline is separate; increased RPC deadline won't fix write-specific timeout.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart the server to clear the stream state",
      "why_fails": "The underlying network issue or blocking I/O persists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set a very large write deadline (e.g., 60s) without investigating root cause",
      "why_fails": "Masks the issue; slow writes can still cause user-perceived timeouts.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure write deadline via channel args: `export GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE=65536` and set `GRPC_ARG_KEEPALIVE_TIME_MS=10000` to detect dead connections faster",
      "success_rate": 0.8,
      "how": "Configure write deadline via channel args: `export GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE=65536` and set `GRPC_ARG_KEEPALIVE_TIME_MS=10000` to detect dead connections faster",
      "condition": "",
      "sources": []
    },
    {
      "action": "In server code, use a separate goroutine with `context.WithTimeout` for write operations to handle slow clients gracefully",
      "success_rate": 0.85,
      "how": "In server code, use a separate goroutine with `context.WithTimeout` for write operations to handle slow clients gracefully",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过通道参数配置写入超时：`export GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE=65536` 并设置 `GRPC_ARG_KEEPALIVE_TIME_MS=10000` 以更快检测死连接",
    "在服务器代码中，使用独立的 goroutine 配合 `context.WithTimeout` 处理写入操作，优雅处理慢客户端"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/deadlines/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}