Skip to content

Commit

Permalink
playground: fix panic (#2076)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaaaaaaang committed Nov 23, 2022
1 parent 4d3dc8b commit 642adbb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions components/playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 642adbb

Please sign in to comment.