mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Remove check for empty activePods list in CPUManager removeStaleState
This check is redundant since we protect this call with a call to `m.sourcesReady.AllReady()` earlier on. Moreover, having this check in place means that we will leave some stale state around in cases where there are actually no active pods in the system and this loop hasn't cleaned them up yet. This can happen, for example, if a pod exits while the kubelet is down for some reason. We see this exact case being triggered in our e2e tests, where a test has been failing since October when this change was first introduced.
This commit is contained in:
parent
5802f3a910
commit
34b942a41d
@ -312,12 +312,6 @@ func (m *manager) removeStaleState() {
|
||||
|
||||
// Get the list of active pods.
|
||||
activePods := m.activePods()
|
||||
if len(activePods) == 0 {
|
||||
// If there are no active pods, skip the removal of stale state.
|
||||
// Since this function is called periodically, we will just try again
|
||||
// next time this function is called.
|
||||
return
|
||||
}
|
||||
|
||||
// Build a list of (podUID, containerName) pairs for all containers in all active Pods.
|
||||
activeContainers := make(map[string]map[string]struct{})
|
||||
|
Loading…
Reference in New Issue
Block a user