Remove outstanding reset from plan applier

This commit is contained in:
Alex Dadgar 2016-03-04 17:25:37 -08:00
parent 5bcfdeb41d
commit 330aec45b9
2 changed files with 1 additions and 12 deletions

View File

@ -78,7 +78,6 @@ type unackEval struct {
Eval *structs.Evaluation
Token string
NackTimer *time.Timer
Paused bool
}
// PendingEvaluations is a list of waiting evaluations.
@ -420,7 +419,7 @@ func (b *EvalBroker) OutstandingReset(evalID, token string) error {
if unack.Token != token {
return ErrTokenMismatch
}
if !unack.Paused && !unack.NackTimer.Reset(b.nackTimeout) {
if !unack.NackTimer.Reset(b.nackTimeout) {
return ErrNackTimeoutReached
}
return nil
@ -526,7 +525,6 @@ func (b *EvalBroker) PauseNackTimeout(evalID, token string) error {
if !unack.NackTimer.Stop() {
return ErrNackTimeoutReached
}
unack.Paused = true
return nil
}
@ -543,7 +541,6 @@ func (b *EvalBroker) ResumeNackTimeout(evalID, token string) error {
return ErrTokenMismatch
}
unack.NackTimer.Reset(b.nackTimeout)
unack.Paused = false
return nil
}

View File

@ -59,14 +59,6 @@ func (s *Server) planApply() {
return
}
// Verify the evaluation is outstanding, and that the tokens match.
if err := s.evalBroker.OutstandingReset(pending.plan.EvalID, pending.plan.EvalToken); err != nil {
s.logger.Printf("[ERR] nomad: plan rejected for evaluation %s: %v",
pending.plan.EvalID, err)
pending.respond(nil, err)
continue
}
// Check if out last plan has completed
select {
case <-waitCh: