go
network_error
ai_generated
true
rpc error: code = Unavailable desc = transport is closing
ID: go/grpc-connection-reset
80%Fix Rate
85%Confidence
0Evidence
2024-10-02First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.10 | active | — | — | — |
Root Cause
The gRPC connection is closed while a call is in progress, often due to server shutdown or network issues.
generic中文
gRPC 连接在调用进行中关闭,通常由于服务器关闭或网络问题。
Workarounds
-
70% success
for i := 0; i < 3; i++ { err := client.Call(ctx, req); if err == nil { break }; time.Sleep(time.Duration(i)*time.Second) } -
90% success
conn, _ := grpc.Dial("addr", grpc.WithInsecure()); client := pb.NewClient(conn)
Dead Ends
Common approaches that don't work:
-
80% fail
If the server is down, retry will fail again.
-
60% fail
Keepalive doesn't prevent abrupt connection resets.