{
  "id": "grpc/stream-creation-failure-max-streams",
  "signature": "INTERNAL: grpc: stream creation failed due to max concurrent streams limit (128) on server",
  "signature_zh": "INTERNAL: grpc: 由于服务器最大并发流限制 (128)，流创建失败",
  "regex": "INTERNAL: grpc: stream creation failed due to max concurrent streams limit \\(\\d+\\) on server",
  "domain": "grpc",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The gRPC server reached its configured maximum number of concurrent streams (default 100 or 128), rejecting new stream creation.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC 服务器达到了配置的最大并发流数（默认 100 或 128），拒绝创建新流。",
  "versions": [
    {
      "version": "gRPC C++ 1.63.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Java 1.61.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Python 1.64.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase max streams limit to an extremely high value like 10000",
      "why_fails": "May cause memory exhaustion and degrade performance; doesn't address inefficient stream usage.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable the stream limit entirely by setting to 0",
      "why_fails": "gRPC interprets 0 as unlimited, but may cause resource starvation and DoS vulnerability.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restart server every time it hits limit",
      "why_fails": "Temporary fix; the issue recurs as traffic grows.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase `GRPC_ARG_HTTP2_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 256) on server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 256)])`",
      "success_rate": 0.8,
      "how": "Increase `GRPC_ARG_HTTP2_MAX_CONCURRENT_STREAMS` to a higher value (e.g., 256) on server: `server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 256)])`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement client-side connection pooling to reuse streams: `channel = grpc.insecure_channel('localhost:50051', options=[('grpc.use_local_subchannel_pool', 1)])`",
      "success_rate": 0.75,
      "how": "Implement client-side connection pooling to reuse streams: `channel = grpc.insecure_channel('localhost:50051', options=[('grpc.use_local_subchannel_pool', 1)])`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在服务器端增加 `GRPC_ARG_HTTP2_MAX_CONCURRENT_STREAMS` 到更高值（如 256）：`server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_concurrent_streams', 256)])`",
    "实现客户端连接池以复用流：`channel = grpc.insecure_channel('localhost:50051', options=[('grpc.use_local_subchannel_pool', 1)])`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/performance/#http2-settings",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.75,
  "resolvable": "true",
  "first_seen": "2024-04-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}