{
  "id": "networking/http2-graceful-shutdown-timeout",
  "signature": "HTTP/2: GOAWAY frame received from server with error code NO_ERROR, but connection closed before graceful shutdown completed",
  "signature_zh": "HTTP/2: 从服务器收到错误码为 NO_ERROR 的 GOAWAY 帧，但在优雅关闭完成前连接已关闭",
  "regex": "HTTP/2: GOAWAY frame received from server with error code NO_ERROR, but connection closed before graceful shutdown completed",
  "domain": "networking",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "An HTTP/2 graceful shutdown timeout occurs when the client receives a GOAWAY frame from the server but fails to complete pending streams within the allowed time, resulting in abrupt connection termination.",
  "root_cause_type": "generic",
  "root_cause_zh": "HTTP/2 优雅关闭超时发生在客户端收到服务器发送的 GOAWAY 帧但未能在允许时间内完成待处理流时，导致连接突然终止。",
  "versions": [
    {
      "version": "nginx 1.25+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apache HTTP Server 2.4.58+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC 1.60+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "增加服务器上的 HTTP/2 流超时（例如 http2_max_streams）无法解决客户端无法快速处理待处理请求的问题。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "完全禁用 HTTP/2 并回退到 HTTP/1.1 可以避免问题，但会失去性能优势，且不是长期解决方案。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "重启负载均衡器或代理可能会清空连接池，但如果应用程序未正确处理 GOAWAY，超时会再次发生。",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure the client to gracefully handle GOAWAY by setting a reasonable grace period: In nginx, add 'http2_recv_timeout 30s;' to the server block to allow pending streams to complete.",
      "success_rate": 0.85,
      "how": "Configure the client to gracefully handle GOAWAY by setting a reasonable grace period: In nginx, add 'http2_recv_timeout 30s;' to the server block to allow pending streams to complete.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement retry logic in the client for failed requests after GOAWAY: In gRPC, use WithWaitForHandshake and retry with backoff.",
      "success_rate": 0.8,
      "how": "Implement retry logic in the client for failed requests after GOAWAY: In gRPC, use WithWaitForHandshake and retry with backoff.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the number of concurrent streams per connection to limit pending work during shutdown: In nginx, set 'http2_max_concurrent_streams 64;'.",
      "success_rate": 0.75,
      "how": "Reduce the number of concurrent streams per connection to limit pending work during shutdown: In nginx, set 'http2_max_concurrent_streams 64;'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Configure the client to gracefully handle GOAWAY by setting a reasonable grace period: In nginx, add 'http2_recv_timeout 30s;' to the server block to allow pending streams to complete.",
    "Implement retry logic in the client for failed requests after GOAWAY: In gRPC, use WithWaitForHandshake and retry with backoff.",
    "Reduce the number of concurrent streams per connection to limit pending work during shutdown: In nginx, set 'http2_max_concurrent_streams 64;'."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://httpwg.org/specs/rfc7540.html#GOAWAY",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}