Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 7.x] Revert "Merge pull request #9345 from mhashizume/PUP-11728/main/splay" #9417

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/puppet/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions lib/puppet/scheduler/splay_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions spec/unit/daemon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down