Jira (PUP-10108) 'everyday' schedule does not run every day

7 views
Skip to first unread message

Per Cederqvist (JIRA)

unread,
Oct 23, 2019, 5:08:02 AM10/23/19
to puppe...@googlegroups.com
Per Cederqvist created an issue
 
Puppet / Bug PUP-10108
'everyday' schedule does not run every day
Issue Type: Bug Bug
Affects Versions: PUP 6.10.1
Assignee: Unassigned
Created: 2019/10/23 2:07 AM
Priority: Normal Normal
Reporter: Per Cederqvist

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.)

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Oct 25, 2019, 4:45:03 PM10/25/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity

Josh Cooper (JIRA)

unread,
Oct 25, 2019, 4:45:03 PM10/25/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10108
 
Re: 'everyday' schedule does not run every day

I would expect puppet to apply the resource during the current run, if the last scheduled run was greater than 1 day - <runinterval>, and the next scheduled run would exceed the schedule. So assuming puppet runs every 30 minutes and last applied the resource at 3am on day X, then I would expect puppet to apply the resource sometime between 2:30am and 3am on day X+1. If puppet never ran during that period, I would expect it to apply the resource as soon as it next runs (since it would have been more than 24 hours).

I'm ignoring external factors like daylight savings changes or ntp changing the clock.

Reply all
Reply to author
Forward
0 new messages