]> git.feebdaed.xyz Git - 0xmirror/kubernetes.git/commit
Fix data race in PriorityQueue.UnschedulablePods()
authorManuel Grandeit <m.grandeit@gmail.com>
Sat, 20 Dec 2025 12:34:01 +0000 (13:34 +0100)
committerManuel Grandeit <m.grandeit@gmail.com>
Sat, 20 Dec 2025 12:46:58 +0000 (13:46 +0100)
commit66d4bd320604a73c978c15109e3c249f040d41d0
tree1e1916a19c251f9c6e3179260b5af67b932e6769
parent7d0b8f979c92253bbc3aade4b3f6c9161e3a839f
Fix data race in PriorityQueue.UnschedulablePods()

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().
pkg/scheduler/backend/queue/scheduling_queue.go