From 52b3cd873dafcc114c00fd95111bcf57818b7903 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 28 Jan 2019 11:57:22 -0800 Subject: runsc: Only uninstall cgroup for sandbox stop. PiperOrigin-RevId: 231263114 Change-Id: I57467a34fe94e395fdd3685462c4fe9776d040a3 --- runsc/container/container.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runsc/container/container.go b/runsc/container/container.go index 1b410c63a..37969d8c5 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -721,7 +721,10 @@ func (c *Container) stop() error { if err := c.Sandbox.DestroyContainer(c.ID); err != nil { return fmt.Errorf("destroying container %q: %v", c.ID, err) } - cgroup = c.Sandbox.Cgroup + // Only uninstall cgroup for sandbox stop. + if c.Sandbox.IsRootContainer(c.ID) { + cgroup = c.Sandbox.Cgroup + } // Only set sandbox to nil after it has been told to destroy the container. c.Sandbox = nil } -- cgit v1.2.3