go
network_error
ai_generated
true
rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: EOF", received prior goaway: code: ENHANCE_YOUR_CALM, debug data: "too_many_pings"
ID: go/grpc-keepalive-too-aggressive
80%Fix Rate
87%Confidence
0Evidence
2024-10-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.50+ | active | — | — | — |
Root Cause
The client sends keepalive pings more frequently than the server's MinTime permits, causing the server to send GOAWAY with ENHANCE_YOUR_CALM.
generic中文
客户端发送 keepalive ping 的频率超过服务端 MinTime 限制,服务端发送 GOAWAY 并附 ENHANCE_YOUR_CALM。
Workarounds
-
90% success
Set client keepalive to at least the server's MinTime (default 5 min): conn, _ := grpc.NewClient(addr, grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: 5*time.Minute, Timeout: 20*time.Second, PermitWithoutStream: false, })) -
85% success
On the server, lower the enforcement threshold: srv := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ MinTime: 10*time.Second, PermitWithoutStream: true, }))
Dead Ends
Common approaches that don't work:
-
60% fail
Loses detection of dead connections through idle NAT/LB timeouts, causing silent hangs.
-
90% fail
MaxConnectionAge is a server option; the client's setting is ignored.