diff --git a/net/ghttp/ghttp_server.go b/net/ghttp/ghttp_server.go index 75944a4892b..80976ee97e9 100644 --- a/net/ghttp/ghttp_server.go +++ b/net/ghttp/ghttp_server.go @@ -247,7 +247,13 @@ func (s *Server) Start() error { // If this is a child process, it then notifies its parent exit. if gproc.IsChild() { - gtimer.SetTimeout(ctx, time.Duration(s.config.GracefulTimeout)*time.Second, func(ctx context.Context) { + var gracefulTimeout = time.Duration(s.config.GracefulTimeout) * time.Second + gtimer.SetTimeout(ctx, gracefulTimeout, func(ctx context.Context) { + intlog.Printf( + ctx, + `pid[%d]: notice parent server graceful shuttingdown, ppid: %d`, + gproc.Pid(), gproc.PPid(), + ) if err := gproc.Send(gproc.PPid(), []byte("exit"), adminGProcCommGroup); err != nil { intlog.Errorf(ctx, `server error in process communication: %+v`, err) } diff --git a/net/ghttp/ghttp_server_admin.go b/net/ghttp/ghttp_server_admin.go index 2928493a40c..109cacb138e 100644 --- a/net/ghttp/ghttp_server_admin.go +++ b/net/ghttp/ghttp_server_admin.go @@ -36,8 +36,14 @@ func (p *utilAdmin) Index(r *Request) {
Pid: {{.pid}}
File Path: {{.path}}
- - ++Restart +please make sure it is running using standalone binary not from IDE or "go run" +
++Shutdown +graceful shutdown the server +