NO_ERROR communication protocol_error ai_generated partial

HTTP/2 GOAWAY 帧收到:最后流 ID 0,错误码 NO_ERROR

HTTP/2 GOAWAY frame received: last stream ID 0, error code NO_ERROR

ID: communication/http2-goaway-frame-received

其他格式: JSON · Markdown 中文 · English
78%修复率
84%置信度
1证据数
2024-05-12首次发现

版本兼容性

版本状态引入弃用备注
nginx 1.25.0 active
Node.js 20.11.0 active
Envoy 1.28.0 active

根因分析

HTTP/2 服务器发送 GOAWAY 帧以优雅关闭连接,通常由于服务器维护、负载均衡或达到最大并发流限制。

English

The HTTP/2 server sent a GOAWAY frame to gracefully shut down the connection, often due to server maintenance, load balancing, or reaching max concurrent streams.

generic

官方文档

https://httpwg.org/specs/rfc7540.html#GOAWAY

解决方案

  1. Implement client-side reconnection logic that opens a new HTTP/2 connection upon receiving GOAWAY: In Node.js with http2 module, listen for 'goaway' event and create a new session: `session.on('goaway', () => { session.close(); createNewSession(); })`.
  2. Set a grace period in the server's GOAWAY handling to allow in-flight requests to complete: In nginx, configure `http2_max_concurrent_streams 256;` and `keepalive_timeout 60s;` to reduce GOAWAY frequency.
  3. Use connection pooling with multiple HTTP/2 sessions to distribute load: In gRPC, configure `grpc.lb_policy_name` as 'round_robin' with multiple subchannels.

无效尝试

常见但无效的做法:

  1. Disable HTTP/2 entirely and fall back to HTTP/1.1 60% 失败

    Disabling HTTP/2 loses performance benefits and doesn't fix the server-side issue; GOAWAY may still occur with HTTP/1.1 connection resets.

  2. Increase the client's max concurrent streams limit 85% 失败

    The GOAWAY is server-initiated; client-side stream limits don't prevent the server from sending it.

  3. Ignore GOAWAY and continue sending requests on the same connection 90% 失败

    GOAWAY signals imminent connection closure; continuing to send will result in stream errors or data loss.