Browse Source

fix race in serializing sandbox to string

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Alexander Morozov 8 năm trước cách đây
mục cha
commit
7a51c79979
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      libnetwork/controller.go

+ 2 - 1
libnetwork/controller.go

@@ -868,8 +868,9 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
 		if s.containerID == containerID {
 		if s.containerID == containerID {
 			// If not a stub, then we already have a complete sandbox.
 			// If not a stub, then we already have a complete sandbox.
 			if !s.isStub {
 			if !s.isStub {
+				sbID := s.ID()
 				c.Unlock()
 				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
 			// We already have a stub sandbox from the