Fix potential containerd panic.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
ca65dc9316
commit
7bd8dcd0d3
@ -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