[rpc] ignore mux close error when close grpc server
cmux.ErrListenerClosed error occurs only when a server is closed
So just ignore it
@@ -109,9 +109,15 @@ func (ns *RPC) grpcWebHandlerFunc(grpcWebServer *grpcweb.WrappedGrpcServer, othe
// Serve GRPC server over TCP
func (ns *RPC) serveGRPC(l net.Listener, server *grpc.Server) {
if err := server.Serve(l); err != nil {
+ switch err {
+ case cmux.ErrListenerClosed:
+ // sometimes this is occured when this is killed by signals
+ // but this is normal case, not bug. so skip
+ default:
panic(err)
}
}
+}
// Serve HTTP server over TCP
func (ns *RPC) serveHTTP(l net.Listener, server *http.Server) {
