Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-10108

'everyday' schedule does not run every day

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 6.10.1
    • None
    • None
    • None
    • Debian 7
    • Coremunity
    • Needs Assessment
    • Needs Assessment

    Description

      Puppet Version: 6.10.1
      Puppet Server Version: 6.10.1
      OS Name/Version: Debian 8 (client) and Debian 9 (server)

      Following the example on https://puppet.com/docs/puppet/latest/types/schedule.html I have the following code (where I have adjusted the range by adding one hour, to avoid issues when daylight savings time start and end):

      schedule { 'everyday':
        period => daily,
        range  => '3 - 5',
      }
       
      exec { '/usr/bin/apt-get update':
        schedule => 'everyday',
      } 

      **I can see in the generated logs for a few day that this runs at the following times:

      2019-10-11 03:05
      2019-10-12 03:05
      2019-10-13 03:05
      2019-10-14 03:05
      2019-10-15 03:05
      2019-10-16 03:35
      2019-10-17 03:37
      2019-10-18 03:37
      2019-10-19 04:07
      2019-10-20 04:07
      2019-10-21 04:36
      2019-10-22 04:37
      

      The apt-get update never ran today (2019-10-23).

      I can understand why.  Arguably, by the time the Puppet run started today at 04:36, 24 hours had not passed since the previous update.  And the next update at 05:07 was outside the window.

      Perhaps this isn't a but in Puppet itself, but rather an issue with the documentation.  I expect (but have not verified) that this issue could be resolved by changing the schedule to this:

       schedule { 'everyday':
        period => daily,
        repeat => 2,
        range  => '3 - 5',
      }

      Desired Behavior:

      I should be able to run apt-get update daily by following the example in the documentation.

      Actual Behavior:

      Since period=>daily enforces a 24-hour wait, and since the Puppet run the next day may run only 23.99 hours later, the command may actually run approximately 24.5 hours later on some days. Once the scheduled time is pushed outside the range execution will be skipped one day.

      (Actually, one could argue that it makes more sense to run apt-get update more often than once a day.  I'm switching to running it 6 times a day, so that security updates are applied more swiftly.)

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ceder Per Cederqvist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support