forked from TrueCloudLab/frostfs-node
[#745] node: Add more debug logs on shutdown
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
3d981320c6
commit
b5cadff2c3
4 changed files with 18 additions and 0 deletions
|
@ -50,9 +50,17 @@ func serveGRPC(c *cfg) {
|
|||
|
||||
go func() {
|
||||
defer func() {
|
||||
c.log.Info("stop listening gRPC endpoint",
|
||||
zap.String("endpoint", lis.Addr().String()),
|
||||
)
|
||||
|
||||
c.wg.Done()
|
||||
}()
|
||||
|
||||
c.log.Info("start listening gRPC endpoint",
|
||||
zap.String("endpoint", lis.Addr().String()),
|
||||
)
|
||||
|
||||
if err := srv.Serve(lis); err != nil {
|
||||
fmt.Println("gRPC server error", err)
|
||||
}
|
||||
|
|
|
@ -117,6 +117,8 @@ func shutdown(c *cfg) {
|
|||
closer()
|
||||
}
|
||||
|
||||
c.log.Debug("waiting for all processes to stop")
|
||||
|
||||
c.wg.Wait()
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,15 @@ func initMetrics(c *cfg) {
|
|||
}))
|
||||
|
||||
c.closers = append(c.closers, func() {
|
||||
c.log.Debug("shutting down metrics service")
|
||||
|
||||
err := srv.Shutdown()
|
||||
if err != nil {
|
||||
c.log.Debug("could not shutdown metrics server",
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
}
|
||||
|
||||
c.log.Debug("metrics service has been stopped")
|
||||
})
|
||||
}
|
||||
|
|
|
@ -30,11 +30,15 @@ func initProfiler(c *cfg) {
|
|||
}))
|
||||
|
||||
c.closers = append(c.closers, func() {
|
||||
c.log.Debug("shutting down profiling service")
|
||||
|
||||
err := srv.Shutdown()
|
||||
if err != nil {
|
||||
c.log.Debug("could not shutdown pprof server",
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
}
|
||||
|
||||
c.log.Debug("profiling service has been stopped")
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue