From 332545c95bf464271d7fbcc9595104f25021eff8 Mon Sep 17 00:00:00 2001 From: bashar-515 Date: Tue, 21 Jan 2025 20:27:50 +0000 Subject: [PATCH] [RSDK-9149] Default gRPC Server to 'Wait For Handlers' (#406) --- rpc/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc/server.go b/rpc/server.go index 1c9f6f8d..79843ac0 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -397,6 +397,8 @@ func NewServer(logger utils.ZapCompatibleLogger, opts ...ServerOption) (Server, serverOpts = append(serverOpts, grpc.StatsHandler(sOpts.statsHandler)) } + serverOpts = append(serverOpts, grpc.WaitForHandlers(true)) + grpcServer := grpc.NewServer( serverOpts..., ) @@ -854,7 +856,7 @@ func (ss *simpleServer) Stop() error { err = multierr.Combine(err, ss.signalingCallQueue.Close()) } ss.logger.Debug("stopping gRPC server") - defer ss.grpcServer.GracefulStop() + defer ss.grpcServer.Stop() ss.logger.Debug("canceling service servers for gateway") for _, cancel := range ss.serviceServerCancels { cancel()