From 7a51c79979c885fd61cdc2b90c5765810ccebad4 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 --- libnetwork/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnetwork/controller.go b/libnetwork/controller.go index 8c3c3a1eae..b8b4c8e0ff 100644 --- a/libnetwork/controller.go +++ b/libnetwork/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