Skip to content

Commit

Permalink
Merge pull request #1512 from mrjana/bugs
Browse files Browse the repository at this point in the history
Fix map access race in populatedEndpoints
  • Loading branch information
Santhosh Manohar authored Oct 18, 2016
2 parents fad68bd + c254f3f commit 6740616
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,9 @@ func (sb *sandbox) clearNetworkResources(origEp *endpoint) error {
releaseOSSboxResources(osSbox, ep)
}

delete(sb.populatedEndpoints, ep.ID())
sb.Lock()
delete(sb.populatedEndpoints, ep.ID())

if len(sb.endpoints) == 0 {
// sb.endpoints should never be empty and this is unexpected error condition
// We log an error message to note this down for debugging purposes.
Expand Down

0 comments on commit 6740616

Please # to comment.