mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
The UnschedulablePods() function iterates over the unschedulablePods.podInfoMap without holding any lock, while other goroutines may concurrently modify the map via addOrUpdate(), delete(), or clear(). Other functions like PendingPods() and GetPod() correctly acquire p.lock.RLock() before accessing unschedulablePods.podInfoMap, but UnschedulablePods() was missing this. Fix by adding p.lock.RLock()/RUnlock() to UnschedulablePods(), matching the pattern used by PendingPods().