From 3d6322f806d64f7381cc92dbf15fba813f756994 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 8 Nov 2022 11:23:11 -0500 Subject: [PATCH] Close GRPCBroker on GRPCServer GracefulStop as well --- grpc_server.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/grpc_server.go b/grpc_server.go index 8250b37e..a23cbcec 100644 --- a/grpc_server.go +++ b/grpc_server.go @@ -110,15 +110,22 @@ func (s *GRPCServer) Init() error { // Stop calls Close on the underlying grpc.Broker and Stop on the underlying // grpc.Server func (s *GRPCServer) Stop() { + s.server.Stop() + if s.broker != nil { s.broker.Close() + s.broker = nil } - s.server.Stop() } // GracefulStop calls GracefulStop on the underlying grpc.Server func (s *GRPCServer) GracefulStop() { s.server.GracefulStop() + + if s.broker != nil { + s.broker.Close() + s.broker = nil + } } // Config is the GRPCServerConfig encoded as JSON then base64.