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
f50761c9
Commit
f50761c9
authored
Sep 08, 2017
by
Kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix prober ticking shift for kubelet restarted cases
parent
92e1f446
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
worker.go
pkg/kubelet/prober/worker.go
+5
-4
No files found.
pkg/kubelet/prober/worker.go
View file @
f50761c9
...
@@ -99,6 +99,11 @@ func newWorker(
...
@@ -99,6 +99,11 @@ func newWorker(
// run periodically probes the container.
// run periodically probes the container.
func
(
w
*
worker
)
run
()
{
func
(
w
*
worker
)
run
()
{
probeTickerPeriod
:=
time
.
Duration
(
w
.
spec
.
PeriodSeconds
)
*
time
.
Second
probeTickerPeriod
:=
time
.
Duration
(
w
.
spec
.
PeriodSeconds
)
*
time
.
Second
// If kubelet restarted the probes could be started in rapid succession.
// Let the worker wait for a random portion of tickerPeriod before probing.
time
.
Sleep
(
time
.
Duration
(
rand
.
Float64
()
*
float64
(
probeTickerPeriod
)))
probeTicker
:=
time
.
NewTicker
(
probeTickerPeriod
)
probeTicker
:=
time
.
NewTicker
(
probeTickerPeriod
)
defer
func
()
{
defer
func
()
{
...
@@ -111,10 +116,6 @@ func (w *worker) run() {
...
@@ -111,10 +116,6 @@ func (w *worker) run() {
w
.
probeManager
.
removeWorker
(
w
.
pod
.
UID
,
w
.
container
.
Name
,
w
.
probeType
)
w
.
probeManager
.
removeWorker
(
w
.
pod
.
UID
,
w
.
container
.
Name
,
w
.
probeType
)
}()
}()
// If kubelet restarted the probes could be started in rapid succession.
// Let the worker wait for a random portion of tickerPeriod before probing.
time
.
Sleep
(
time
.
Duration
(
rand
.
Float64
()
*
float64
(
probeTickerPeriod
)))
probeLoop
:
probeLoop
:
for
w
.
doProbe
()
{
for
w
.
doProbe
()
{
// Wait for next probe tick.
// Wait for next probe tick.
...
...
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