Skip to content

Commit

Permalink
Merge pull request puppetlabs#8181 from joshcooper/lock_race_condition
Browse files Browse the repository at this point in the history
(maint) Don't retry the lock if the deadline is now
  • Loading branch information
melissa committed May 27, 2020
2 parents 94c7d4c + 14fe57a commit 9b5bd2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def run(client_options = {})
now = Time.now.to_i
wait_for_lock_deadline ||= now + Puppet[:maxwaitforlock]

if Puppet[:waitforlock] < 1
if Puppet[:waitforlock] < 1
Puppet.notice _("Run of %{client_class} already in progress; skipping (%{lockfile_path} exists)") % { client_class: client_class, lockfile_path: lockfile_path }
nil
elsif now > wait_for_lock_deadline
elsif now >= wait_for_lock_deadline
Puppet.notice _("Exiting now because the maxwaitforlock timeout has been exceeded.")
nil
else
Expand Down

0 comments on commit 9b5bd2a

Please sign in to comment.