Files
containerd/runtime
Wei Fu 8b51a95fb2 fix: shimv1 leak issue
```go
// Delete the initial process and container
func (s *Service) Delete(ctx context.Context, r *ptypes.Empty) (*shimapi.DeleteResponse, error) {
        p, err := s.getInitProcess()
        if err != nil {
                return nil, err
        }
        if err := p.Delete(ctx); err != nil {
                return nil, errdefs.ToGRPC(err)
        }

	// The client might canceled the request but the shim service still
	// moved on. The `delete(s.processes, s.id)` was executed
	// successfully. So the next Delete call will return `container
	// must be created` error. The client side should ignore this
	// issue.

        s.mu.Lock()
        delete(s.processes, s.id)
        s.mu.Unlock()
        s.platform.Close()
        return &shimapi.DeleteResponse{
                ExitStatus: uint32(p.ExitStatus()),
                ExitedAt:   protobuf.ToTimestamp(p.ExitedAt()),
                Pid:        uint32(p.Pid()),
        }, nil
}
```

introduced by #9004
fixes: #9309

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 449912857d)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-11-07 22:40:49 +08:00
..
2021-10-08 17:48:33 -07:00
2023-11-07 22:40:49 +08:00
2018-02-19 10:32:26 +09:00
2021-07-23 10:04:46 -07:00
2021-08-04 10:38:05 -07:00
2018-02-19 10:32:26 +09:00