From 93eead6d2242732b6c2ce85d746adef3cc907443 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Tue, 4 Oct 2016 15:40:47 -0700 Subject: [PATCH] fix race in serializing sandbox to string Signed-off-by: Alexander Morozov --- controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller.go b/controller.go index 8c3c3a1eae..b8b4c8e0ff 100644 --- a/controller.go +++ b/controller.go @@ -868,8 +868,9 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s if s.containerID == containerID { // If not a stub, then we already have a complete sandbox. if !s.isStub { + sbID := s.ID() c.Unlock() - return nil, types.ForbiddenErrorf("container %s is already present: %v", containerID, s) + return nil, types.ForbiddenErrorf("container %s is already present in sandbox %s", containerID, sbID) } // We already have a stub sandbox from the