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
b0bcb8f7
Commit
b0bcb8f7
authored
Jul 19, 2016
by
k8s-merge-robot
Committed by
GitHub
Jul 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29100 from wojtek-t/pods_can_never_be_scheduled_again
Automatic merge from submit-queue Fix disappearing pods in scheduler Fix #29098
parents
0bfaae16
66009877
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
factory.go
plugin/pkg/scheduler/factory/factory.go
+15
-5
No files found.
plugin/pkg/scheduler/factory/factory.go
View file @
b0bcb8f7
...
@@ -48,6 +48,8 @@ import (
...
@@ -48,6 +48,8 @@ import (
const
(
const
(
SchedulerAnnotationKey
=
"scheduler.alpha.kubernetes.io/name"
SchedulerAnnotationKey
=
"scheduler.alpha.kubernetes.io/name"
initialGetBackoff
=
100
*
time
.
Millisecond
maximalGetBackoff
=
time
.
Minute
)
)
// ConfigFactory knows how to fill out a scheduler config with its support functions.
// ConfigFactory knows how to fill out a scheduler config with its support functions.
...
@@ -531,12 +533,20 @@ func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue
...
@@ -531,12 +533,20 @@ func (factory *ConfigFactory) makeDefaultErrorFunc(backoff *podBackoff, podQueue
}
}
// Get the pod again; it may have changed/been scheduled already.
// Get the pod again; it may have changed/been scheduled already.
pod
=
&
api
.
Pod
{}
pod
=
&
api
.
Pod
{}
err
:=
factory
.
Client
.
Get
()
.
Namespace
(
podID
.
Namespace
)
.
Resource
(
"pods"
)
.
Name
(
podID
.
Name
)
.
Do
()
.
Into
(
pod
)
getBackoff
:=
initialGetBackoff
if
err
!=
nil
{
for
{
if
!
errors
.
IsNotFound
(
err
)
{
if
err
:=
factory
.
Client
.
Get
()
.
Namespace
(
podID
.
Namespace
)
.
Resource
(
"pods"
)
.
Name
(
podID
.
Name
)
.
Do
()
.
Into
(
pod
);
err
==
nil
{
glog
.
Errorf
(
"Error getting pod %v for retry: %v; abandoning"
,
podID
,
err
)
break
}
}
return
if
errors
.
IsNotFound
(
err
)
{
glog
.
Warning
(
"A pod %v no longer exists"
,
podID
)
return
}
glog
.
Errorf
(
"Error getting pod %v for retry: %v; retrying..."
,
podID
,
err
)
if
getBackoff
=
getBackoff
*
2
;
getBackoff
>
maximalGetBackoff
{
getBackoff
=
maximalGetBackoff
}
time
.
Sleep
(
getBackoff
)
}
}
if
pod
.
Spec
.
NodeName
==
""
{
if
pod
.
Spec
.
NodeName
==
""
{
podQueue
.
AddIfNotPresent
(
pod
)
podQueue
.
AddIfNotPresent
(
pod
)
...
...
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