go network_error ai_generated true

rpc 错误:代码 = 不可用,描述 = grpc:服务器已停止

rpc error: code = Unavailable desc = grpc: the server has been stopped

ID: go/grpc-server-shutdown

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

版本兼容性

版本状态引入弃用备注
1.60.0 active

根因分析

客户端尝试与已优雅停止或正在关闭的 gRPC 服务器通信。

English

The client attempted to communicate with a gRPC server that has been gracefully stopped or is in the process of shutting down.

generic

解决方案

  1. 85% 成功率
    Implement client-side health checks to detect server availability and reconnect when it comes back.
  2. 90% 成功率
    Use a connection pool that can re-establish connections after server restart.

无效尝试

常见但无效的做法:

  1. 80% 失败

  2. 60% 失败