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

View file

@ -59,14 +59,6 @@ func (s *Server) planApply() {
return 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 // Check if out last plan has completed
select { select {
case <-waitCh: case <-waitCh: