{
  "id": "communication/grpc-deadline-exceeded-streaming",
  "signature": "grpc::DEADLINE_EXCEEDED: Deadline exceeded on streaming call to /service/StreamMethod",
  "signature_zh": "grpc::DEADLINE_EXCEEDED: 对 /service/StreamMethod 的流式调用超时",
  "regex": "grpc::DEADLINE_EXCEEDED: Deadline exceeded on streaming call to /[\\w./]+",
  "domain": "communication",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "gRPC client deadline configured too short or server processing too slow for streaming RPC, causing the context to expire before the stream completes.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC 客户端配置的超时时间过短，或服务器处理流式 RPC 速度过慢，导致上下文在流完成前过期。",
  "versions": [
    {
      "version": "gRPC 1.50.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC 1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Envoy 1.28.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase client deadline to a very large value (e.g., 60 seconds) across all calls",
      "why_fails": "Can mask underlying performance issues and cause resource exhaustion if server is genuinely slow.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable deadline checking entirely in client configuration",
      "why_fails": "Removes timeout protection, leading to hung connections and cascading failures.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart the gRPC server without changing deadline or processing logic",
      "why_fails": "Temporary fix; deadline will trigger again if server processing remains slow.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the client deadline for streaming calls specifically, e.g., in Go: `ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)` instead of default 5s.",
      "success_rate": 0.75,
      "how": "Increase the client deadline for streaming calls specifically, e.g., in Go: `ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)` instead of default 5s.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement server-side streaming with backpressure using flow control: configure `grpc.max_concurrent_streams` and `grpc.initial_window_size` to avoid server overload.",
      "success_rate": 0.85,
      "how": "Implement server-side streaming with backpressure using flow control: configure `grpc.max_concurrent_streams` and `grpc.initial_window_size` to avoid server overload.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add retry with exponential backoff in the client for deadline-exceeded errors, e.g., using gRPC retry policy: `retryPolicy: { maxAttempts: 3, initialBackoff: 1s, maxBackoff: 10s, backoffMultiplier: 2 }`.",
      "success_rate": 0.8,
      "how": "Add retry with exponential backoff in the client for deadline-exceeded errors, e.g., using gRPC retry policy: `retryPolicy: { maxAttempts: 3, initialBackoff: 1s, maxBackoff: 10s, backoffMultiplier: 2 }`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "专门为流式调用增加客户端超时时间，例如在 Go 中：`ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)` 替代默认的 5 秒。",
    "在服务器端实现带背压的流式处理：配置 `grpc.max_concurrent_streams` 和 `grpc.initial_window_size` 以避免服务器过载。",
    "在客户端为超时错误添加指数退避重试，例如使用 gRPC 重试策略：`retryPolicy: { maxAttempts: 3, initialBackoff: 1s, maxBackoff: 10s, backoffMultiplier: 2 }`。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/deadlines/",
  "official_doc_section": null,
  "error_code": "GRPC_DEADLINE_EXCEEDED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}