shimv2: update container status when process exited#1625
shimv2: update container status when process exited#1625lifupan wants to merge 1 commit intokata-containers:masterfrom
Conversation
|
/test |
When a container process terminated, shimv2 should update container's status internally, otherwise, ctr command would get a wrong container status even the process had exited. Fixes:kata-containers#1602 Signed-off-by: lifupan <lifupan@gmail.com>
|
/test |
| } | ||
|
|
||
| // If the container has stopped, return directly when killed with | ||
| // SIGKILL or SIGTERM signal. |
There was a problem hiding this comment.
Why we still send other signal except SIGKILL and SIGTERM when container is stop
There was a problem hiding this comment.
We cannot make sure when/what signals containerd would send, here only filter out the sigterm/sigkill signal.
There was a problem hiding this comment.
I think the signal should be send to container, if the container init process are stopped, it won't deal the signal, I see kata agent will discard signal if container stop, so it also ok here.
https://github.com/kata-containers/agent/blob/master/grpc.go#L908
There was a problem hiding this comment.
Actually if the container has been stopped, the signal hadn't reached agent and would returned here
runtime/virtcontainers/container.go
Line 1075 in a7e2bbd
Here the filter would make sure even the container has been stopped, send SIGKILL/SIGTERM signal wouldn't return an err.
| if err != nil { | ||
| return nil, errors.Wrap(err, "kill container") | ||
| } | ||
| if status.State.State == types.StateStopped { |
There was a problem hiding this comment.
Why do we need to fake success here? runc shim doesn't do it either. It feels like container state between containerd and kata shimv2 mismatched.
|
Close this PR since another one #1723 would fix the same issue. |
When a container process terminated, shimv2 should update
container's status internally, otherwise, ctr command would
get a wrong container status even the process had exited.
Fixes:#1602
Signed-off-by: lifupan lifupan@gmail.com