Merge pull request #2976 from Random-Liu/fix-potential-panic
Fix potential containerd panic.
This commit is contained in:
commit
5ba368748b
@ -111,9 +111,11 @@ func (p *process) Start(ctx context.Context) error {
|
|||||||
ExecID: p.id,
|
ExecID: p.id,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.io.Cancel()
|
if p.io != nil {
|
||||||
p.io.Wait()
|
p.io.Cancel()
|
||||||
p.io.Close()
|
p.io.Wait()
|
||||||
|
p.io.Close()
|
||||||
|
}
|
||||||
return errdefs.FromGRPC(err)
|
return errdefs.FromGRPC(err)
|
||||||
}
|
}
|
||||||
p.pid = r.Pid
|
p.pid = r.Pid
|
||||||
|
6
task.go
6
task.go
@ -189,8 +189,10 @@ func (t *task) Start(ctx context.Context) error {
|
|||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.io.Cancel()
|
if t.io != nil {
|
||||||
t.io.Close()
|
t.io.Cancel()
|
||||||
|
t.io.Close()
|
||||||
|
}
|
||||||
return errdefs.FromGRPC(err)
|
return errdefs.FromGRPC(err)
|
||||||
}
|
}
|
||||||
t.pid = r.Pid
|
t.pid = r.Pid
|
||||||
|
Loading…
Reference in New Issue
Block a user