Skip to content

Commit 6099a73

Browse files
authored
Merge pull request kubernetes#86919 from ahg-g/ahg-fix
Fix how we check for node info list consistency
2 parents 99600ae + 591b870 commit 6099a73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/scheduler/internal/cache/cache.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ func (cache *schedulerCache) UpdateNodeInfoSnapshot(nodeSnapshot *nodeinfosnapsh
261261
cache.updateNodeInfoSnapshotList(nodeSnapshot, updateAllLists)
262262
}
263263

264-
if len(nodeSnapshot.NodeInfoList) != len(nodeSnapshot.NodeInfoMap) {
265-
errMsg := fmt.Sprintf("snapshot state is not consistent, length of NodeInfoList=%v not equal to length of NodeInfoMap=%v "+
266-
"length of nodes in cache=%v, length of nodes in tree=%v"+
264+
if len(nodeSnapshot.NodeInfoList) != cache.nodeTree.numNodes {
265+
errMsg := fmt.Sprintf("snapshot state is not consistent, length of NodeInfoList=%v not equal to length of nodes in tree=%v "+
266+
", length of NodeInfoMap=%v, length of nodes in cache=%v"+
267267
", trying to recover",
268-
len(nodeSnapshot.NodeInfoList), len(nodeSnapshot.NodeInfoMap),
269-
len(cache.nodes), cache.nodeTree.numNodes)
268+
len(nodeSnapshot.NodeInfoList), cache.nodeTree.numNodes,
269+
len(nodeSnapshot.NodeInfoMap), len(cache.nodes))
270270
klog.Error(errMsg)
271271
// We will try to recover by re-creating the lists for the next scheduling cycle, but still return an
272272
// error to surface the problem, the error will likely cause a failure to the current scheduling cycle.

0 commit comments

Comments
 (0)