mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
webconsole: fix defer order to release zombie process
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/util/signalutils"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/webconsole"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
@@ -66,9 +67,15 @@ func StartService() {
|
||||
|
||||
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, o.OnOptionsChange)
|
||||
|
||||
registerSigTraps()
|
||||
start()
|
||||
}
|
||||
|
||||
func registerSigTraps() {
|
||||
signalutils.SetDumpStackSignal()
|
||||
signalutils.StartTrap()
|
||||
}
|
||||
|
||||
func start() {
|
||||
baseOpts := &o.Options.BaseOptions
|
||||
// commonOpts := &o.Options.CommonOptions
|
||||
|
||||
@@ -102,6 +102,10 @@ func (p *Pty) Resize(size *pty.Winsize) {
|
||||
func (p *Pty) Stop() (err error) {
|
||||
var errs []error
|
||||
|
||||
defer func() {
|
||||
p.Cmd, p.Pty = nil, nil
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
err = errors.NewAggregate(errs)
|
||||
}()
|
||||
@@ -139,8 +143,5 @@ func (p *Pty) Stop() (err error) {
|
||||
}
|
||||
}()
|
||||
|
||||
defer func() {
|
||||
p.Cmd, p.Pty = nil, nil
|
||||
}()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user