mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-05 22:32:20 +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")
|
logger.Infof("gracefully shutting down the service")
|
||||||
startTime = time.Now()
|
startTime = time.Now()
|
||||||
stopStaleSnapshotsRemover()
|
stopStaleSnapshotsRemover()
|
||||||
vmselectSrv.MustClose()
|
vmselectSrv.MustStop()
|
||||||
vminsertSrv.MustClose()
|
vminsertSrv.MustStop()
|
||||||
common.StopUnmarshalWorkers()
|
common.StopUnmarshalWorkers()
|
||||||
logger.Infof("successfully shut down the service in %.3f seconds", time.Since(startTime).Seconds())
|
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)
|
bc, err := handshake.VMInsertServer(c, compressionLevel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if s.isStopping() {
|
if s.isStopping() {
|
||||||
// c is stopped inside VMInsertServer.MustClose
|
// c is stopped inside VMInsertServer.MustStop
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.Errorf("cannot perform vminsert handshake with client %q: %s", c.RemoteAddr(), err)
|
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")
|
vminsertMetricsRead = metrics.NewCounter("vm_vminsert_metrics_read_total")
|
||||||
)
|
)
|
||||||
|
|
||||||
// MustClose gracefully closes s so it no longer touches s.storage after returning.
|
// MustStop gracefully stops s so it no longer touches s.storage after returning.
|
||||||
func (s *VMInsertServer) MustClose() {
|
func (s *VMInsertServer) MustStop() {
|
||||||
// Mark the server as stoping.
|
// Mark the server as stoping.
|
||||||
s.setIsStopping()
|
s.setIsStopping()
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ func (s *Server) run() {
|
|||||||
bc, err := handshake.VMSelectServer(c, compressionLevel)
|
bc, err := handshake.VMSelectServer(c, compressionLevel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if s.isStopping() {
|
if s.isStopping() {
|
||||||
// c is closed inside Server.MustClose
|
// c is closed inside Server.MustStop
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.Errorf("cannot perform vmselect handshake with client %q: %s", c.RemoteAddr(), err)
|
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.
|
// MustStop gracefully stops s, so it no longer touches s.api after returning.
|
||||||
func (s *Server) MustClose() {
|
func (s *Server) MustStop() {
|
||||||
// Mark the server as stoping.
|
// Mark the server as stoping.
|
||||||
s.setIsStopping()
|
s.setIsStopping()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user