Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7e621ccb
Unverified
Commit
7e621ccb
authored
Nov 16, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71063 from Huang-Wei/nodeinfo-clone-panic
fix a scheduler panic due to internal cache inconsistency
parents
1f3057b7
a86ba8b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
generic_scheduler.go
pkg/scheduler/core/generic_scheduler.go
+3
-1
generic_scheduler_test.go
pkg/scheduler/core/generic_scheduler_test.go
+5
-0
No files found.
pkg/scheduler/core/generic_scheduler.go
View file @
7e621ccb
...
...
@@ -895,7 +895,6 @@ func selectNodesForPreemption(pod *v1.Pod,
queue
internalqueue
.
SchedulingQueue
,
pdbs
[]
*
policy
.
PodDisruptionBudget
,
)
(
map
[
*
v1
.
Node
]
*
schedulerapi
.
Victims
,
error
)
{
nodeToVictims
:=
map
[
*
v1
.
Node
]
*
schedulerapi
.
Victims
{}
var
resultLock
sync
.
Mutex
...
...
@@ -984,6 +983,9 @@ func selectVictimsOnNode(
queue
internalqueue
.
SchedulingQueue
,
pdbs
[]
*
policy
.
PodDisruptionBudget
,
)
([]
*
v1
.
Pod
,
int
,
bool
)
{
if
nodeInfo
==
nil
{
return
nil
,
0
,
false
}
potentialVictims
:=
util
.
SortableList
{
CompFunc
:
util
.
HigherPriorityPod
}
nodeInfoCopy
:=
nodeInfo
.
Clone
()
...
...
pkg/scheduler/core/generic_scheduler_test.go
View file @
7e621ccb
...
...
@@ -960,6 +960,11 @@ func TestSelectNodesForPreemption(t *testing.T) {
test
.
predicates
[
algorithmpredicates
.
MatchInterPodAffinityPred
]
=
algorithmpredicates
.
NewPodAffinityPredicate
(
FakeNodeInfo
(
*
nodes
[
0
]),
schedulertesting
.
FakePodLister
(
test
.
pods
))
}
nodeNameToInfo
:=
schedulercache
.
CreateNodeNameToInfoMap
(
test
.
pods
,
nodes
)
// newnode simulate a case that a new node is added to the cluster, but nodeNameToInfo
// doesn't have it yet.
newnode
:=
makeNode
(
"newnode"
,
1000
*
5
,
priorityutil
.
DefaultMemoryRequest
*
5
)
newnode
.
ObjectMeta
.
Labels
=
map
[
string
]
string
{
"hostname"
:
"newnode"
}
nodes
=
append
(
nodes
,
newnode
)
nodeToPods
,
err
:=
selectNodesForPreemption
(
test
.
pod
,
nodeNameToInfo
,
nodes
,
test
.
predicates
,
PredicateMetadata
,
nil
,
nil
)
if
err
!=
nil
{
t
.
Error
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment