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
e17343d8
Commit
e17343d8
authored
7 years ago
by
Chelsea Holland Komlo
Browse files
Options
Download
Email Patches
Plain Diff
set driver to unhealthy once if it cannot be detected in periodic check
parent
179db0df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/fingerprint_manager.go
+14
-0
client/fingerprint_manager.go
with
14 additions
and
0 deletions
+14
-0
client/fingerprint_manager.go
+
14
-
0
View file @
e17343d8
package
client
import
(
"fmt"
"log"
"strings"
"sync"
...
...
@@ -308,6 +309,19 @@ func (fm *FingerprintManager) watchDriver(d driver.Driver, name string) {
if
err
:=
fm
.
runDriverHealthCheck
(
name
,
hc
);
err
!=
nil
{
fm
.
logger
.
Printf
(
"[DEBUG] client.fingerprint_manager: health checking for %v failed: %v"
,
name
,
err
)
}
}
else
{
// If the driver is undetected, change the health status to unhealthy
// only once.
healthInfo
:=
&
structs
.
DriverInfo
{
Healthy
:
detected
,
HealthDescription
:
fmt
.
Sprintf
(
"Driver %s is not detected"
,
name
),
UpdateTime
:
time
.
Now
(),
}
if
node
:=
fm
.
updateNodeFromDriver
(
name
,
nil
,
healthInfo
);
node
!=
nil
{
fm
.
nodeLock
.
Lock
()
fm
.
node
=
node
fm
.
nodeLock
.
Unlock
()
}
}
}
}
...
...
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