From 61d0b10e475b24034565ecc29e68826b8f4ffac6 Mon Sep 17 00:00:00 2001 From: chengshiwen Date: Sun, 8 Sep 2024 02:27:15 +0800 Subject: [PATCH] fix influxd close and reset issue --- cmd/influxd/run/server.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index 95b8d68..b2a7bde 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -547,6 +547,10 @@ func (s *Server) Close() error { s.config.deregisterDiagnostics(s.Monitor) + if s.ShardWriter != nil { + s.ShardWriter.Close() + } + if s.PointsWriter != nil { s.PointsWriter.Close() } @@ -555,6 +559,10 @@ func (s *Server) Close() error { s.HintedHandoff.Close() } + if s.MetaExecutor != nil { + s.MetaExecutor.Close() + } + if s.QueryExecutor != nil { s.QueryExecutor.Close() } @@ -600,7 +608,9 @@ func (s *Server) Reset() error { s.closing = svr.closing s.MetaClient = svr.MetaClient s.TSDBStore = svr.TSDBStore + s.ClusterStore = svr.ClusterStore s.QueryExecutor = svr.QueryExecutor + s.MetaExecutor = svr.MetaExecutor s.PointsWriter = svr.PointsWriter s.ShardWriter = svr.ShardWriter s.HintedHandoff = svr.HintedHandoff