Open ImpBY opened 1 month ago
jruby consumption before and after patch
~1200 agents
# (optional) maximum number of JRuby instances to allow
max-active-instances: 32
max-queued-requests: 64
max-retry-delay: 120 ## seconds before retry
splay = true
splaylimit = 30m
runinterval = 30m
issue has been added by this pull request https://github.com/puppetlabs/puppet/pull/9345
how it looks like before/after and downgrade.
Migrated issue to PUP-12061
This issue was originally filed due to a regression after merging https://github.com/puppetlabs/puppet/pull/9345 and released in 8.7.0/7.31.0. The change was reverted in https://github.com/puppetlabs/puppet/issues/9415 and released in 8.8.1 and 7.32.1. Since this issue contains a possible fix for the regression, we're repurposing this ticket for the original issue described in PUP-11728.
Describe the Bug
splay is recalculated even if the splay_limit has not changed https://puppetcommunity.slack.com/archives/C0W298S9G/p1721059192632569
Expected Behavior
this leads to the fact that the probability of the first launch of the puppet increases over time. upon reaching 1/3 of the time from the splay_limit it becomes almost 100%. as a result the agent will perform the first run within 1/3 of the splay_limit. by default it is 10 min (splay_limit 30 min)
Steps to Reproduce
Steps to reproduce the behavior:
add code to lib/puppet/scheduler/splay_job.rb
watch realtime changes of splay
diff --git lib/puppet/scheduler/splay_job.rb lib/puppet/scheduler/splay_job.rb index b44e08bad6..d2a5643324 100644 --- lib/puppet/scheduler/splay_job.rb +++ lib/puppet/scheduler/splay_job.rb @@ -1,6 +1,7 @@ module Puppet::Scheduler class SplayJob < Job attr_reader :splay
attr_reader :splay_limit_previous
def initialize(run_interval, splay_limit, &block) @splay = calculate_splay(splay_limit) @@ -29,7 +34,10 @@ module Puppet::Scheduler
@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)