kata-containers/agent

container process is leak

xs3c opened this issue · 0 comments

xs3c commented

Description of problem

The grpc request is add a default timeout by @bergwolf , but

agent: add default timeout for grpc requests

When creating container, if the grpc request is immediately timeout after calling execProcess, and not add the container to sandbox.

in finishCreateContainer()
.... 
err = a.execProcess(ctr, ctr.initProcess, true); err != nil {
                return emptyResp, err
        }
----> grpc request is timeout 
a.sandbox.setContainer(ctr.ctx, req.ContainerId, ctr)
...

so we should make sure add container to sandbox before calling execProcess, at the same time, invoking stopContainer in rollbackingFailingContainerCreation.

Expected result

Actual result