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
3d50c471
Commit
3d50c471
authored
7 years ago
by
Alex Dadgar
Browse files
Options
Download
Email Patches
Plain Diff
small review feedback fixes
parent
7df7a6fd
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nomad/deploymentwatcher/deployment_watcher.go
+5
-3
nomad/deploymentwatcher/deployment_watcher.go
nomad/structs/structs.go
+3
-3
nomad/structs/structs.go
scheduler/reconcile.go
+1
-1
scheduler/reconcile.go
with
9 additions
and
7 deletions
+9
-7
nomad/deploymentwatcher/deployment_watcher.go
+
5
-
3
View file @
3d50c471
...
...
@@ -345,11 +345,13 @@ func (w *deploymentWatcher) StopWatch() {
// watch is the long running watcher that watches for both allocation and
// deployment changes. Its function is to create evaluations to trigger the
// scheduler when more progress can be made, to fail the deployment if it has
// failed and potentially rolling back the job.
// failed and potentially rolling back the job. Progress can be made when an
// allocation transistions to healthy, so we create an eval.
func
(
w
*
deploymentWatcher
)
watch
()
{
// Get the deadline. This is likely a zero time to begin with but we need to
// handle the case that the deployment has already progressed and we are now
// just starting to watch it.
// just starting to watch it. This must likely would occur if there was a
// leader transistion and we are now starting our watcher.
currentDeadline
:=
getDeploymentProgressCutoff
(
w
.
getDeployment
())
var
deadlineTimer
*
time
.
Timer
if
currentDeadline
.
IsZero
()
{
...
...
@@ -373,7 +375,7 @@ FAIL:
return
case
<-
deadlineTimer
.
C
:
// We have hit the progress deadline so fail the deployment. We need
// to determine whether we should rollback the job by inspecting
// to determine whether we should roll
back the job by inspecting
// which allocs as part of the deployment are healthy and which
// aren't.
var
err
error
...
...
This diff is collapsed.
Click to expand it.
nomad/structs/structs.go
+
3
-
3
View file @
3d50c471
...
...
@@ -2493,7 +2493,7 @@ type UpdateStrategy struct {
HealthyDeadline
time
.
Duration
// ProgressDeadline is the time in which an allocation as part of the
// deployment must transi
s
tion to healthy. If no allocation becomes healthy
// deployment must transition to healthy. If no allocation becomes healthy
// after the deadline, the deployment is marked as failed. If the deadline
// is zero, the first failure causes the deployment to fail.
ProgressDeadline
time
.
Duration
...
...
@@ -5416,11 +5416,11 @@ type DeploymentState struct {
// reverted on failure
AutoRevert
bool
// ProgressDeadline is the deadline by which an allocation must transi
s
tion
// ProgressDeadline is the deadline by which an allocation must transition
// to healthy before the deployment is considered failed.
ProgressDeadline
time
.
Duration
// RequireProgressBy is the time by which an allocation must transi
s
tion
// RequireProgressBy is the time by which an allocation must transition
// to healthy before the deployment is considered failed.
RequireProgressBy
time
.
Time
...
...
This diff is collapsed.
Click to expand it.
scheduler/reconcile.go
+
1
-
1
View file @
3d50c471
...
...
@@ -197,7 +197,7 @@ func (a *allocReconciler) Compute() *reconcileResults {
// XXX Fix
// XXX An idea for not replacing failed allocs that are part of
// deployment that will fail immediately is to only replace them if
// their desired transi
s
tion has a replace bool set by the deployment
// their desired transition has a replace bool set by the deployment
// watcher.
// Detect if any allocs associated with this deploy have failed
...
...
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