{
  "id": "grpc/flow-control-window-exhausted",
  "signature": "INTERNAL: grpc: flow control window exhausted for stream 123",
  "signature_zh": "INTERNAL: grpc: 流 123 的流量控制窗口已耗尽",
  "regex": "INTERNAL: grpc: flow control window exhausted",
  "domain": "grpc",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The HTTP/2 flow control window for a specific stream is exhausted because the receiver is not consuming data fast enough, leading to a stall or internal error.",
  "root_cause_type": "generic",
  "root_cause_zh": "特定流的 HTTP/2 流量控制窗口已耗尽，因为接收方没有足够快地消耗数据，导致停滞或内部错误。",
  "versions": [
    {
      "version": "gRPC v1.56.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.63.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Restarting the client or server without changing flow control settings.",
      "why_fails": "The window exhaustion recurs under the same load pattern; restarting only provides temporary relief.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling flow control entirely by setting `grpc.http2.lookahead_bytes` to 0.",
      "why_fails": "Flow control is a fundamental HTTP/2 mechanism; disabling it can cause memory exhaustion and connection instability.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increasing the number of worker threads on the receiver side.",
      "why_fails": "While it may help consume data faster, the root cause is often slow application-level processing, not thread count.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the initial flow control window size on the server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.initial_reconnect_backoff_ms', 1000), ('grpc.http2.min_recv_flow_control_window', 8388608)])`",
      "success_rate": 0.85,
      "how": "Increase the initial flow control window size on the server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.initial_reconnect_backoff_ms', 1000), ('grpc.http2.min_recv_flow_control_window', 8388608)])`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Optimize the receiver's data consumption by batching reads or using async I/O to avoid blocking the event loop.",
      "success_rate": 0.8,
      "how": "Optimize the receiver's data consumption by batching reads or using async I/O to avoid blocking the event loop.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement backpressure at the application layer: have the client send smaller chunks or wait for acknowledgments before sending more data.",
      "success_rate": 0.75,
      "how": "Implement backpressure at the application layer: have the client send smaller chunks or wait for acknowledgments before sending more data.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase the initial flow control window size on the server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.initial_reconnect_backoff_ms', 1000), ('grpc.http2.min_recv_flow_control_window', 8388608)])`",
    "Optimize the receiver's data consumption by batching reads or using async I/O to avoid blocking the event loop.",
    "Implement backpressure at the application layer: have the client send smaller chunks or wait for acknowledgments before sending more data."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/flow-control/",
  "official_doc_section": null,
  "error_code": "EFLOWCTRL",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}