Skip to content

Commit

Permalink
[RSDK-9149] Default gRPC Server to 'Wait For Handlers' (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashar-515 authored Jan 21, 2025
1 parent da065ad commit 332545c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...,
)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 332545c

Please sign in to comment.