From abea43275717e24addccc3bf45cf1c299f34f1f7 Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Tue, 16 Jul 2024 14:53:14 -0700 Subject: [PATCH] Revert "Merge pull request #9345 from mhashizume/PUP-11728/main/splay" This reverts commit 7f0770c25d03324e29b6438db7acc933799e7e29, reversing changes made to c26087122aa9750894ac14667a1540e6c6cf56f5. (cherry picked from commit a1a84cb90f150f71b9d83f2598ba9ef53ad5d702) --- lib/puppet/daemon.rb | 1 - lib/puppet/scheduler/splay_job.rb | 9 --------- spec/unit/daemon_spec.rb | 12 ------------ 3 files changed, 22 deletions(-) diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb index 6e4e99d0013..2f7458e13d4 100644 --- a/lib/puppet/daemon.rb +++ b/lib/puppet/daemon.rb @@ -161,7 +161,6 @@ def run_event_loop reparse_run = Puppet::Scheduler.create_job(Puppet[:filetimeout]) do Puppet.settings.reparse_config_files agent_run.run_interval = Puppet[:runinterval] - agent_run.splay_limit = Puppet[:splaylimit] if Puppet[:splay] if Puppet[:filetimeout] == 0 reparse_run.disable else diff --git a/lib/puppet/scheduler/splay_job.rb b/lib/puppet/scheduler/splay_job.rb index b44e08bad64..1e0c116d06e 100644 --- a/lib/puppet/scheduler/splay_job.rb +++ b/lib/puppet/scheduler/splay_job.rb @@ -23,15 +23,6 @@ def ready?(time) end end - # Recalculates splay. - # - # @param splay_limit [Integer] the maximum time (in seconds) to delay before an agent's first run. - # @return @splay [Integer] a random integer less than or equal to the splay limit that represents the seconds to - # delay before next agent run. - def splay_limit=(splay_limit) - @splay = calculate_splay(splay_limit) - end - private def calculate_splay(limit) diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb index d666469b9ee..575923d8479 100644 --- a/spec/unit/daemon_spec.rb +++ b/spec/unit/daemon_spec.rb @@ -86,18 +86,6 @@ def run_loop(jobs) daemon.start expect(scheduler.jobs[0]).not_to be_enabled end - - it "recalculates splay if splaylimit changes" do - # Set file timeout so the daemon reparses - Puppet[:filetimeout] = 1 - Puppet[:splay] = true - allow(agent).to receive(:run) - daemon.start - first_splay = scheduler.jobs[1].splay - allow(Kernel).to receive(:rand).and_return(1738) - scheduler.jobs[0].run(Time.now) - expect(scheduler.jobs[1].splay).to_not eq(first_splay) - end end describe "when stopping" do