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
aac60b6c
Commit
aac60b6c
authored
Nov 30, 2017
by
wackxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete a node from its cache if it gets node not found error
parent
16027080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
factory.go
plugin/pkg/scheduler/factory/factory.go
+15
-0
No files found.
plugin/pkg/scheduler/factory/factory.go
View file @
aac60b6c
...
...
@@ -1109,6 +1109,21 @@ func (factory *configFactory) MakeDefaultErrorFunc(backoff *util.PodBackoff, pod
}
else
{
if
_
,
ok
:=
err
.
(
*
core
.
FitError
);
ok
{
glog
.
V
(
4
)
.
Infof
(
"Unable to schedule %v %v: no fit: %v; waiting"
,
pod
.
Namespace
,
pod
.
Name
,
err
)
}
else
if
errors
.
IsNotFound
(
err
)
{
if
errStatus
,
ok
:=
err
.
(
errors
.
APIStatus
);
ok
&&
errStatus
.
Status
()
.
Details
.
Kind
==
"node"
{
nodeName
:=
errStatus
.
Status
()
.
Details
.
Name
// when node is not found, We do not remove the node right away. Trying again to get
// the node and if the node is still not found, then remove it from the scheduler cache.
_
,
err
:=
factory
.
client
.
CoreV1
()
.
Nodes
()
.
Get
(
nodeName
,
metav1
.
GetOptions
{})
if
err
!=
nil
&&
errors
.
IsNotFound
(
err
)
{
node
:=
v1
.
Node
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
nodeName
}}
factory
.
schedulerCache
.
RemoveNode
(
&
node
)
// invalidate cached predicate for the node
if
factory
.
enableEquivalenceClassCache
{
factory
.
equivalencePodCache
.
InvalidateAllCachedPredicateItemOfNode
(
nodeName
)
}
}
}
}
else
{
glog
.
Errorf
(
"Error scheduling %v %v: %v; retrying"
,
pod
.
Namespace
,
pod
.
Name
,
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