Skip to content

Commit

Permalink
fix race in serializing sandbox to string
Browse files Browse the repository at this point in the history
moby/libnetwork#1495

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Signed-off-by: Lei Jitang <leijitang@huawei.com>
  • Loading branch information
coolljt0725 committed Jun 26, 2017
1 parent 3953dad commit d635c83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vendor/src/github.com/docker/libnetwork/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,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.BadRequestErrorf("container %s is already present: %v", containerID, s)
return nil, types.BadRequestErrorf("container %s is already present in sandbox: %s", containerID, sbID)
}

// We already have a stub sandbox from the
Expand Down

0 comments on commit d635c83

Please sign in to comment.