go
network_error
ai_generated
true
rpc error: code = Unavailable desc = connection error: desc = "transport: http2Client.notifyError got notified that the client transport was broken EOF"
ID: go/grpc-keepalive-too-frequent
80%Fix Rate
86%Confidence
0Evidence
2024-09-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| google.golang.org/grpc v1.55+ | active | — | — | — |
Root Cause
Client keepalive pings are more frequent than the server's enforcement policy allows; the server sends GOAWAY and closes the connection.
generic中文
客户端 keepalive ping 频率高于服务器强制策略允许的值;服务器发送 GOAWAY 并关闭连接。
Workarounds
-
92% success
kp := keepalive.ClientParameters{ Time: 5 * time.Minute, Timeout: 20 * time.Second, PermitWithoutStream: false, } conn, _ := grpc.NewClient(addr, grpc.WithKeepaliveParams(kp), grpc.WithTransportCredentials(insecure.NewCredentials()), ) -
88% success
s := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ MinTime: 10 * time.Second, PermitWithoutStream: false, }))
Dead Ends
Common approaches that don't work:
-
70% fail
Idle connections behind NAT/LB get silently dropped; subsequent RPCs fail with Unavailable.
-
95% fail
Makes the problem worse — server enforces MinTime and closes the connection faster.