Issue #20447 has been updated by Andrew Parker.
More refactorings related to this merged into master at [3326e2a9339c58dd11979c2b58d2b6974d7ccf7d](https://github.com/puppetlabs/puppet/commit/3326e2a9339c58dd11979c2b58d2b6974d7ccf7d) ---------------------------------------- Bug #20447: Job scheduler causes puppet master to shut down when all jobs are disabled https://projects.puppetlabs.com/issues/20447#change-90487 * Author: Charlie Sharpsteen * Status: Merged - Pending Release * Priority: Normal * Assignee: * Category: * Target version: 3.2.0 * Affected Puppet version: 3.2.0-rc1 * Keywords: daemon scheduler * Branch: ---------------------------------------- When all jobs are set to be disabled, `interval_to_next_run` [performs the following calculation](https://github.com/puppetlabs/puppet/blob/6ce05d60c8ba74d98508ad9c64a3980f3a02a7c8/lib/puppet/scheduler/scheduler.rb#L10-L12): <pre> @jobs.select(&:enabled?).map do |j| j.interval_to_next_from(now) end.min </pre> This returns `nil` which causes daemons to die during startup. A simple test case is to add `filetimeout = 0` to the stock `puppet.conf`: <pre> [main] # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet # Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet # Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl filetimeout = 0 [agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt # Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig </pre> This causes the puppet master to fail during startup: <pre> [root@puppetmaster ~]# puppet master --no-daemonize --verbose --trace Notice: Starting Puppet master version 3.1.1-680-g6ce05d6 Error: Could not run: undefined method `>' for nil:NilClass /puppetlabs/puppet/lib/puppet/scheduler/timer.rb:4:in `wait_for' /puppetlabs/puppet/lib/puppet/scheduler/scheduler.rb:28:in `run_once' /puppetlabs/puppet/lib/puppet/scheduler/scheduler.rb:34:in `run_loop' /puppetlabs/puppet/lib/puppet/scheduler/scheduler.rb:33:in `loop' /puppetlabs/puppet/lib/puppet/scheduler/scheduler.rb:33:in `run_loop' /puppetlabs/puppet/lib/puppet/daemon.rb:169:in `run_event_loop' /puppetlabs/puppet/lib/puppet/daemon.rb:146:in `start' /puppetlabs/puppet/lib/puppet/application/master.rb:215:in `main' /puppetlabs/puppet/lib/puppet/application/master.rb:165:in `run_command' /puppetlabs/puppet/lib/puppet/application.rb:364:in `run' /puppetlabs/puppet/lib/puppet/application.rb:456:in `plugin_hook' /puppetlabs/puppet/lib/puppet/application.rb:364:in `run' /puppetlabs/puppet/lib/puppet/util.rb:504:in `exit_on_fail' /puppetlabs/puppet/lib/puppet/application.rb:364:in `run' /puppetlabs/puppet/lib/puppet/util/command_line.rb:132:in `run' /puppetlabs/puppet/lib/puppet/util/command_line.rb:86:in `execute' /puppetlabs/puppet/bin/puppet:4 </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
