Skip to content

Commit

Permalink
added new entry to changelog and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanadelacuesta committed Mar 27, 2023
1 parent 3cbb6f4 commit 75ccde6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/16583.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
server: Added verification of cron jobs already running before forcing new evals right after leader change
```
2 changes: 1 addition & 1 deletion nomad/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ func (s *Server) restorePeriodicDispatcher() error {
continue
}

if _, err := s.periodicDispatcher.ForceRun(job.Namespace, job.ID); err != nil {
if _, err := s.periodicDispatcher.ForceEval(job.Namespace, job.ID); err != nil {
logger.Error("force run of periodic job failed", "job", job.NamespacedID(), "error", err)
return fmt.Errorf("force run of periodic job %q failed: %v", job.NamespacedID(), err)
}
Expand Down
2 changes: 1 addition & 1 deletion nomad/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (p *PeriodicDispatch) removeLocked(jobID structs.NamespacedID) error {
return nil
}

// ForceRun causes the periodic job to be evaluated immediately and returns the
// ForceEval causes the periodic job to be evaluated immediately and returns the
// subsequent eval.
func (p *PeriodicDispatch) ForceEval(namespace, jobID string) (*structs.Evaluation, error) {
p.l.Lock()
Expand Down

0 comments on commit 75ccde6

Please sign in to comment.