diff --git a/components/playground/playground.go b/components/playground/playground.go index f1de7f78c9..279fdb9bb5 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -1013,55 +1013,55 @@ func (p *Playground) terminate(sig syscall.Signal) { timer.Stop() } - if p.monitor != nil { + if p.monitor != nil && p.monitor.cmd != nil && p.monitor.cmd.Process != nil { go kill("prometheus", p.monitor.cmd.Process.Pid, p.monitor.wait) } - if p.ngmonitoring != nil { + if p.ngmonitoring != nil && p.ngmonitoring.cmd != nil && p.ngmonitoring.cmd.Process != nil { go kill("ng-monitoring", p.ngmonitoring.cmd.Process.Pid, p.ngmonitoring.wait) } - if p.grafana != nil { + if p.grafana != nil && p.grafana.cmd != nil && p.grafana.cmd.Process != nil { go kill("grafana", p.grafana.cmd.Process.Pid, p.grafana.wait) } for _, inst := range p.tiflashs { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.ticdcs { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.tikvCdcs { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.drainers { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } // tidb must exit earlier then pd for _, inst := range p.tidbs { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.pumps { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.tikvs { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } } for _, inst := range p.pds { - if inst.Process != nil { + if inst.Process != nil && inst.Process.Cmd() != nil && inst.Process.Cmd().Process != nil { kill(inst.Component(), inst.Pid(), inst.Wait) } }