Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
b58a22c2
Commit
b58a22c2
authored
7 years ago
by
Michael Schurter
Browse files
Options
Download
Email Patches
Plain Diff
remove spurious TODOs and FIXMEs
parent
ec09ea61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/alloc_runner_health_watcher.go
+5
-8
client/alloc_runner_health_watcher.go
nomad/drainer/drain_heap.go
+0
-3
nomad/drainer/drain_heap.go
nomad/structs/structs.go
+0
-1
nomad/structs/structs.go
with
5 additions
and
12 deletions
+5
-12
client/alloc_runner_health_watcher.go
+
5
-
8
View file @
b58a22c2
...
@@ -196,12 +196,11 @@ func newAllocHealthTracker(parentCtx context.Context, logger *log.Logger, alloc
...
@@ -196,12 +196,11 @@ func newAllocHealthTracker(parentCtx context.Context, logger *log.Logger, alloc
minHealthyTime
time
.
Duration
,
useChecks
bool
)
*
allocHealthTracker
{
minHealthyTime
time
.
Duration
,
useChecks
bool
)
*
allocHealthTracker
{
a
:=
&
allocHealthTracker
{
a
:=
&
allocHealthTracker
{
logger
:
logger
,
logger
:
logger
,
healthy
:
make
(
chan
bool
,
1
),
healthy
:
make
(
chan
bool
,
1
),
allocStopped
:
make
(
chan
struct
{}),
allocStopped
:
make
(
chan
struct
{}),
alloc
:
alloc
,
alloc
:
alloc
,
tg
:
alloc
.
Job
.
LookupTaskGroup
(
alloc
.
TaskGroup
),
tg
:
alloc
.
Job
.
LookupTaskGroup
(
alloc
.
TaskGroup
),
//FIXME should i wrap all these parameters up in a struct?
minHealthyTime
:
minHealthyTime
,
minHealthyTime
:
minHealthyTime
,
useChecks
:
useChecks
,
useChecks
:
useChecks
,
allocUpdates
:
allocUpdates
,
allocUpdates
:
allocUpdates
,
...
@@ -260,7 +259,6 @@ func (a *allocHealthTracker) TaskEvents() map[string]string {
...
@@ -260,7 +259,6 @@ func (a *allocHealthTracker) TaskEvents() map[string]string {
// Go through are task information and build the event map
// Go through are task information and build the event map
for
task
,
state
:=
range
a
.
taskHealth
{
for
task
,
state
:=
range
a
.
taskHealth
{
//FIXME skip this for migrations?
useChecks
:=
a
.
tg
.
Update
.
HealthCheck
==
structs
.
UpdateStrategyHealthCheck_Checks
useChecks
:=
a
.
tg
.
Update
.
HealthCheck
==
structs
.
UpdateStrategyHealthCheck_Checks
if
e
,
ok
:=
state
.
event
(
deadline
,
a
.
tg
.
Update
.
MinHealthyTime
,
useChecks
);
ok
{
if
e
,
ok
:=
state
.
event
(
deadline
,
a
.
tg
.
Update
.
MinHealthyTime
,
useChecks
);
ok
{
events
[
task
]
=
e
events
[
task
]
=
e
...
@@ -542,7 +540,6 @@ func (t *taskHealthState) event(deadline time.Time, minHealthyTime time.Duration
...
@@ -542,7 +540,6 @@ func (t *taskHealthState) event(deadline time.Time, minHealthyTime time.Duration
}
}
// We are running so check if we have been running long enough
// We are running so check if we have been running long enough
//FIXME need minHealthyTime here
if
t
.
state
.
StartedAt
.
Add
(
minHealthyTime
)
.
After
(
deadline
)
{
if
t
.
state
.
StartedAt
.
Add
(
minHealthyTime
)
.
After
(
deadline
)
{
return
fmt
.
Sprintf
(
"Task not running for min_healthy_time of %v by deadline"
,
minHealthyTime
),
true
return
fmt
.
Sprintf
(
"Task not running for min_healthy_time of %v by deadline"
,
minHealthyTime
),
true
}
}
...
...
This diff is collapsed.
Click to expand it.
nomad/drainer/drain_heap.go
+
0
-
3
View file @
b58a22c2
...
@@ -20,9 +20,6 @@ type DrainDeadlineNotifier interface {
...
@@ -20,9 +20,6 @@ type DrainDeadlineNotifier interface {
Watch
(
nodeID
string
,
deadline
time
.
Time
)
Watch
(
nodeID
string
,
deadline
time
.
Time
)
}
}
// TODO Make any of what I just wrote true :) Initially it is just a simple
// implementation.
// deadlineHeap implements the DrainDeadlineNotifier and is backed by a min-heap
// deadlineHeap implements the DrainDeadlineNotifier and is backed by a min-heap
// to efficiently determine the next deadlining node. It also supports
// to efficiently determine the next deadlining node. It also supports
// coalescing several deadlines into a single emission.
// coalescing several deadlines into a single emission.
...
...
This diff is collapsed.
Click to expand it.
nomad/structs/structs.go
+
0
-
1
View file @
b58a22c2
...
@@ -1193,7 +1193,6 @@ const (
...
@@ -1193,7 +1193,6 @@ const (
// ShouldDrainNode checks if a given node status should trigger an
// ShouldDrainNode checks if a given node status should trigger an
// evaluation. Some states don't require any further action.
// evaluation. Some states don't require any further action.
//TODO(schmichael) Update for drainv2?!
func
ShouldDrainNode
(
status
string
)
bool
{
func
ShouldDrainNode
(
status
string
)
bool
{
switch
status
{
switch
status
{
case
NodeStatusInit
,
NodeStatusReady
:
case
NodeStatusInit
,
NodeStatusReady
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help