Skip to content

Commit

Permalink
Merge pull request moby#1778 from WeiZhang555/fix-leaking-netns-file
Browse files Browse the repository at this point in the history
[bug]Fix race between sandbox.delete() and SetKey()
  • Loading branch information
mavenugo authored Jun 14, 2017
2 parents 0585b10 + 0f17689 commit 9f6f2c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libnetwork/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ func (sb *sandbox) SetKey(basePath string) error {
}

sb.Lock()
if sb.inDelete {
sb.Unlock()
return types.ForbiddenErrorf("failed to SetKey: sandbox %q delete in progress", sb.id)
}
oldosSbox := sb.osSbox
sb.Unlock()

Expand Down

0 comments on commit 9f6f2c2

Please sign in to comment.