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
1f1551a4
Commit
1f1551a4
authored
6 years ago
by
Mahmood Ali
Browse files
Options
Download
Email Patches
Plain Diff
add logging about attempts
parent
ba373fee
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/allocrunner/taskrunner/logmon_hook.go
+5
-3
client/allocrunner/taskrunner/logmon_hook.go
with
5 additions
and
3 deletions
+5
-3
client/allocrunner/taskrunner/logmon_hook.go
+
5
-
3
View file @
1f1551a4
...
...
@@ -97,18 +97,20 @@ func reattachConfigFromHookData(data map[string]string) (*plugin.ReattachConfig,
func
(
h
*
logmonHook
)
Prestart
(
ctx
context
.
Context
,
req
*
interfaces
.
TaskPrestartRequest
,
resp
*
interfaces
.
TaskPrestartResponse
)
error
{
trie
s
:=
0
attempt
s
:=
0
for
{
err
:=
h
.
prestartOneLoop
(
ctx
,
req
)
if
err
==
bstructs
.
ErrPluginShutdown
{
h
.
logger
.
Warn
(
"logmon shutdown while making request"
,
"error"
,
err
)
if
tries
>
3
{
if
attempts
>
3
{
h
.
logger
.
Warn
(
"logmon shutdown while making request; giving up"
,
"attempts"
,
attempts
,
"error"
,
err
)
return
err
}
// retry after killing process and ensure we start a new logmon process
tries
++
attempts
++
h
.
logger
.
Warn
(
"logmon shutdown while making request; retrying"
,
"attempts"
,
attempts
,
"error"
,
err
)
h
.
logmonPluginClient
.
Kill
()
time
.
Sleep
(
1
*
time
.
Second
)
continue
...
...
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