mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Only lock statuses map when status isn't successful
Determine the status successful or not first, that will reduce the chance of lock contention.
This commit is contained in:
parent
9b78bd5979
commit
dc52b69ddc
@ -333,13 +333,13 @@ func (g *genericScheduler) findNodesThatPassFilters(ctx context.Context, prof *p
|
|||||||
feasibleNodes[length-1] = nodeInfo.Node()
|
feasibleNodes[length-1] = nodeInfo.Node()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
statusesLock.Lock()
|
|
||||||
if !status.IsSuccess() {
|
if !status.IsSuccess() {
|
||||||
|
statusesLock.Lock()
|
||||||
statuses[nodeInfo.Node().Name] = status
|
statuses[nodeInfo.Node().Name] = status
|
||||||
}
|
|
||||||
statusesLock.Unlock()
|
statusesLock.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
beginCheckNode := time.Now()
|
beginCheckNode := time.Now()
|
||||||
statusCode := framework.Success
|
statusCode := framework.Success
|
||||||
|
Loading…
Reference in New Issue
Block a user