From 1d9f4e0a5caf13bdb453840c9f41309bea06ee34 Mon Sep 17 00:00:00 2001 From: Xiaofan <83447078+xiaofan-luan@users.noreply.github.com> Date: Tue, 30 Nov 2021 10:59:42 +0800 Subject: [PATCH] Add log when server is stopped (#12233) Signed-off-by: xiaofan-luan --- internal/distributed/datacoord/service.go | 1 + internal/distributed/datanode/service.go | 1 + internal/distributed/indexcoord/service.go | 1 + internal/distributed/indexnode/service.go | 1 + internal/distributed/proxy/service.go | 1 + internal/distributed/querycoord/service.go | 1 + internal/distributed/querynode/service.go | 1 + internal/distributed/rootcoord/service.go | 12 +++++++----- 8 files changed, 14 insertions(+), 5 deletions(-) diff --git a/internal/distributed/datacoord/service.go b/internal/distributed/datacoord/service.go index f23233460..046e56bf4 100644 --- a/internal/distributed/datacoord/service.go +++ b/internal/distributed/datacoord/service.go @@ -167,6 +167,7 @@ func (s *Server) start() error { // Stop stops the DataCoord server gracefully. // Need to call the GracefulStop interface of grpc server and call the stop method of the inner DataCoord object. func (s *Server) Stop() error { + log.Debug("Datacoord stop", zap.String("Address", Params.Address)) var err error if s.closer != nil { if err = s.closer.Close(); err != nil { diff --git a/internal/distributed/datanode/service.go b/internal/distributed/datanode/service.go index cb748e9aa..7d7bd3f6d 100644 --- a/internal/distributed/datanode/service.go +++ b/internal/distributed/datanode/service.go @@ -151,6 +151,7 @@ func (s *Server) Run() error { } func (s *Server) Stop() error { + log.Debug("Datanode stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { return err diff --git a/internal/distributed/indexcoord/service.go b/internal/distributed/indexcoord/service.go index ba136bfdc..1edeae3a7 100644 --- a/internal/distributed/indexcoord/service.go +++ b/internal/distributed/indexcoord/service.go @@ -114,6 +114,7 @@ func (s *Server) start() error { // Stop stops IndexCoord's grpc service. func (s *Server) Stop() error { + log.Debug("Indexcoord stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { return err diff --git a/internal/distributed/indexnode/service.go b/internal/distributed/indexnode/service.go index 96faf1c16..3feb1854d 100644 --- a/internal/distributed/indexnode/service.go +++ b/internal/distributed/indexnode/service.go @@ -168,6 +168,7 @@ func (s *Server) start() error { // Stop stops IndexNode's grpc service. func (s *Server) Stop() error { + log.Debug("IndexNode stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { return err diff --git a/internal/distributed/proxy/service.go b/internal/distributed/proxy/service.go index baecd450f..3a19ecb6b 100644 --- a/internal/distributed/proxy/service.go +++ b/internal/distributed/proxy/service.go @@ -269,6 +269,7 @@ func (s *Server) start() error { // Stop stop the Proxy Server func (s *Server) Stop() error { + log.Debug("Proxy stop", zap.String("Address", Params.Address)) var err error if s.closer != nil { if err = s.closer.Close(); err != nil { diff --git a/internal/distributed/querycoord/service.go b/internal/distributed/querycoord/service.go index cc136acf7..29f370737 100644 --- a/internal/distributed/querycoord/service.go +++ b/internal/distributed/querycoord/service.go @@ -266,6 +266,7 @@ func (s *Server) start() error { // Stop stops QueryCoord's grpc service. func (s *Server) Stop() error { + log.Debug("QueryCoord stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { return err diff --git a/internal/distributed/querynode/service.go b/internal/distributed/querynode/service.go index b8e86bf70..f7869e611 100644 --- a/internal/distributed/querynode/service.go +++ b/internal/distributed/querynode/service.go @@ -251,6 +251,7 @@ func (s *Server) Run() error { // Stop stops QueryNode's grpc service. func (s *Server) Stop() error { + log.Debug("QueryNode stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { return err diff --git a/internal/distributed/rootcoord/service.go b/internal/distributed/rootcoord/service.go index 8e35c87e3..a1c463396 100644 --- a/internal/distributed/rootcoord/service.go +++ b/internal/distributed/rootcoord/service.go @@ -264,31 +264,33 @@ func (s *Server) start() error { } func (s *Server) Stop() error { + log.Debug("Rootcoord stop", zap.String("Address", Params.Address)) if s.closer != nil { if err := s.closer.Close(); err != nil { - log.Error("close opentracing", zap.Error(err)) + log.Error("Failed to close opentracing", zap.Error(err)) } } if s.indexCoord != nil { if err := s.indexCoord.Stop(); err != nil { - log.Debug("close indexCoord client", zap.Error(err)) + log.Error("Failed to close indexCoord client", zap.Error(err)) } } if s.dataCoord != nil { if err := s.dataCoord.Stop(); err != nil { - log.Debug("close dataCoord client", zap.Error(err)) + log.Error("Failed to close dataCoord client", zap.Error(err)) } } if s.queryCoord != nil { if err := s.queryCoord.Stop(); err != nil { - log.Debug("close queryCoord client", zap.Error(err)) + log.Error("Failed to close queryCoord client", zap.Error(err)) } } if s.rootCoord != nil { if err := s.rootCoord.Stop(); err != nil { - log.Debug("close rootCoord", zap.Error(err)) + log.Error("Failed to close close rootCoord", zap.Error(err)) } } + log.Debug("Rootcoord begin to stop grpc server") s.cancel() if s.grpcServer != nil { s.grpcServer.GracefulStop() -- GitLab