Browse Source

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

[bug]Fix race between sandbox.delete() and SetKey()
Madhu Venugopal 8 năm trước cách đây
mục cha
commit
9f6f2c27f8
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      libnetwork/sandbox.go

+ 4 - 0
libnetwork/sandbox.go

@@ -629,6 +629,10 @@ func (sb *sandbox) SetKey(basePath string) error {
 	}
 	}
 
 
 	sb.Lock()
 	sb.Lock()
+	if sb.inDelete {
+		sb.Unlock()
+		return types.ForbiddenErrorf("failed to SetKey: sandbox %q delete in progress", sb.id)
+	}
 	oldosSbox := sb.osSbox
 	oldosSbox := sb.osSbox
 	sb.Unlock()
 	sb.Unlock()