Merge pull request #1778 from WeiZhang555/fix-leaking-netns-file

[bug]Fix race between sandbox.delete() and SetKey()
This commit is contained in:
Madhu Venugopal 2017-06-13 20:06:09 -07:00 committed by GitHub
commit 9f6f2c27f8

View file

@ -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()