diff --git a/app/vmstorage/main.go b/app/vmstorage/main.go index 4f53f98682..8a087fbf14 100644 --- a/app/vmstorage/main.go +++ b/app/vmstorage/main.go @@ -131,8 +131,8 @@ func main() { logger.Infof("gracefully shutting down the service") startTime = time.Now() stopStaleSnapshotsRemover() - vmselectSrv.MustClose() - vminsertSrv.MustClose() + vmselectSrv.MustStop() + vminsertSrv.MustStop() common.StopUnmarshalWorkers() logger.Infof("successfully shut down the service in %.3f seconds", time.Since(startTime).Seconds()) diff --git a/app/vmstorage/servers/vminsert.go b/app/vmstorage/servers/vminsert.go index d747b306f5..017b34d977 100644 --- a/app/vmstorage/servers/vminsert.go +++ b/app/vmstorage/servers/vminsert.go @@ -95,7 +95,7 @@ func (s *VMInsertServer) run() { bc, err := handshake.VMInsertServer(c, compressionLevel) if err != nil { if s.isStopping() { - // c is stopped inside VMInsertServer.MustClose + // c is stopped inside VMInsertServer.MustStop return } logger.Errorf("cannot perform vminsert handshake with client %q: %s", c.RemoteAddr(), err) @@ -131,8 +131,8 @@ var ( vminsertMetricsRead = metrics.NewCounter("vm_vminsert_metrics_read_total") ) -// MustClose gracefully closes s so it no longer touches s.storage after returning. -func (s *VMInsertServer) MustClose() { +// MustStop gracefully stops s so it no longer touches s.storage after returning. +func (s *VMInsertServer) MustStop() { // Mark the server as stoping. s.setIsStopping() diff --git a/lib/vmselectapi/server.go b/lib/vmselectapi/server.go index c58ea305e0..f9e389d01a 100644 --- a/lib/vmselectapi/server.go +++ b/lib/vmselectapi/server.go @@ -160,7 +160,7 @@ func (s *Server) run() { bc, err := handshake.VMSelectServer(c, compressionLevel) if err != nil { if s.isStopping() { - // c is closed inside Server.MustClose + // c is closed inside Server.MustStop return } logger.Errorf("cannot perform vmselect handshake with client %q: %s", c.RemoteAddr(), err) @@ -187,8 +187,8 @@ func (s *Server) run() { } } -// MustClose gracefully closes s, so it no longer touches s.api after returning. -func (s *Server) MustClose() { +// MustStop gracefully stops s, so it no longer touches s.api after returning. +func (s *Server) MustStop() { // Mark the server as stoping. s.setIsStopping()