From 08483d18adea186c75463305d4040d218e5d68d4 Mon Sep 17 00:00:00 2001 From: Li Yuxuan Date: Tue, 6 Aug 2019 15:55:49 +0800 Subject: [PATCH] v2: Close ttrpc connection when `Delete()` This avoids potential socket leak when the connected v2 shim of runtime serving multiple containers. Signed-off-by: Li Yuxuan --- runtime/v2/shim.go | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index 38cf79899..7014de9ff 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -221,6 +221,7 @@ func (s *shim) Delete(ctx context.Context) (*runtime.Exit, error) { if err := s.waitShutdown(ctx); err != nil { log.G(ctx).WithError(err).Error("failed to shutdown shim") } + s.Close() if err := s.bundle.Delete(); err != nil { log.G(ctx).WithError(err).Error("failed to delete bundle") }