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
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.
官方文档
https://httpwg.org/specs/rfc7540.html#GOAWAY解决方案
-
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(); })`. -
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.
-
Use connection pooling with multiple HTTP/2 sessions to distribute load: In gRPC, configure `grpc.lb_policy_name` as 'round_robin' with multiple subchannels.
无效尝试
常见但无效的做法:
-
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.
-
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.
-
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.