mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
lib/vmselectapi: rename Server.MustClose to more clear Server.MustStop
This commit is contained in:
parent
270e555f47
commit
2e721f7d16
@ -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())
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user