{
  "id": "go/grpc-stream-send-after-close",
  "signature": "rpc error: code = Internal desc = grpc: failed to send message: stream terminated by RST_STREAM",
  "signature_zh": "rpc 错误：code = Internal desc = grpc: 发送消息失败: 流被 RST_STREAM 终止",
  "regex": "rpc\\ error:\\ code\\ =\\ Internal\\ desc\\ =\\ grpc:\\ failed\\ to\\ send\\ message:\\ stream\\ terminated\\ by\\ RST_STREAM",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "A server-streaming or bidi-streaming handler called Send after the stream was already closed by the client or by an earlier error. The HTTP/2 stream was reset.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务端流或双向流处理函数在流已被客户端关闭或先前错误关闭后调用了 Send。HTTP/2 流已被重置。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Once the stream is reset, every subsequent Send fails; continuing wastes CPU and delays cleanup.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "CloseSend signals end of client sends; calling it mid-stream terminates the stream prematurely.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Check the error from Send and return immediately: if err := stream.Send(msg); err != nil { return status.Errorf(codes.Internal, \"send: %v\", err) }.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Watch ctx.Done() in the streaming loop and exit gracefully when the client disconnects: select { case <-ctx.Done(): return ctx.Err(); default: }.",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}