cpu_manager.go (kubernetes-1.18.14) | : | cpu_manager.go (kubernetes-1.18.15) | ||
---|---|---|---|---|
skipping to change at line 389 | skipping to change at line 389 | |||
continue | continue | |||
} | } | |||
if cstatus.State.Waiting != nil || | if cstatus.State.Waiting != nil || | |||
(cstatus.State.Waiting == nil && cstatus.State.Ru nning == nil && cstatus.State.Terminated == nil) { | (cstatus.State.Waiting == nil && cstatus.State.Ru nning == nil && cstatus.State.Terminated == nil) { | |||
klog.Warningf("[cpumanager] reconcileState: skipp ing container; container still in the waiting state (pod: %s, container: %s, err or: %v)", pod.Name, container.Name, err) | klog.Warningf("[cpumanager] reconcileState: skipp ing container; container still in the waiting state (pod: %s, container: %s, err or: %v)", pod.Name, container.Name, err) | |||
failure = append(failure, reconciledContainer{pod .Name, container.Name, ""}) | failure = append(failure, reconciledContainer{pod .Name, container.Name, ""}) | |||
continue | continue | |||
} | } | |||
m.Lock() | ||||
if cstatus.State.Terminated != nil { | if cstatus.State.Terminated != nil { | |||
// The container is terminated but we can't call m.RemoveContainer() | // The container is terminated but we can't call m.RemoveContainer() | |||
// here because it could remove the allocated cpu set for the container | // here because it could remove the allocated cpu set for the container | |||
// which may be in the process of being restarted . That would result | // which may be in the process of being restarted . That would result | |||
// in the container losing any exclusively-alloca ted CPUs that it | // in the container losing any exclusively-alloca ted CPUs that it | |||
// was allocated. | // was allocated. | |||
_, _, err := m.containerMap.GetContainerRef(conta inerID) | _, _, err := m.containerMap.GetContainerRef(conta inerID) | |||
if err == nil { | if err == nil { | |||
klog.Warningf("[cpumanager] reconcileStat e: ignoring terminated container (pod: %s, container id: %s)", pod.Name, contain erID) | klog.Warningf("[cpumanager] reconcileStat e: ignoring terminated container (pod: %s, container id: %s)", pod.Name, contain erID) | |||
} | } | |||
m.Unlock() | ||||
continue | continue | |||
} | } | |||
// Once we make it here we know we have a running contain er. | // Once we make it here we know we have a running contain er. | |||
// Idempotently add it to the containerMap incase it is m issing. | // Idempotently add it to the containerMap incase it is m issing. | |||
// This can happen after a kubelet restart, for example. | // This can happen after a kubelet restart, for example. | |||
m.containerMap.Add(string(pod.UID), container.Name, conta inerID) | m.containerMap.Add(string(pod.UID), container.Name, conta inerID) | |||
m.Unlock() | ||||
cset := m.state.GetCPUSetOrDefault(string(pod.UID), conta iner.Name) | cset := m.state.GetCPUSetOrDefault(string(pod.UID), conta iner.Name) | |||
if cset.IsEmpty() { | if cset.IsEmpty() { | |||
// NOTE: This should not happen outside of tests. | // NOTE: This should not happen outside of tests. | |||
klog.Infof("[cpumanager] reconcileState: skipping container; assigned cpuset is empty (pod: %s, container: %s)", pod.Name, contai ner.Name) | klog.Infof("[cpumanager] reconcileState: skipping container; assigned cpuset is empty (pod: %s, container: %s)", pod.Name, contai ner.Name) | |||
failure = append(failure, reconciledContainer{pod .Name, container.Name, containerID}) | failure = append(failure, reconciledContainer{pod .Name, container.Name, containerID}) | |||
continue | continue | |||
} | } | |||
klog.V(4).Infof("[cpumanager] reconcileState: updating co ntainer (pod: %s, container: %s, container id: %s, cpuset: \"%v\")", pod.Name, c ontainer.Name, containerID, cset) | klog.V(4).Infof("[cpumanager] reconcileState: updating co ntainer (pod: %s, container: %s, container id: %s, cpuset: \"%v\")", pod.Name, c ontainer.Name, containerID, cset) | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added |