Bug 858672

Summary: Schedules with monthly intervals don't calculate the next run correctly
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: async/tasksAssignee: Jason Connor <jconnor>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: MasterCC: mmccune, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 40   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-09 17:07:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jay Dobies 2012-09-19 11:55:48 UTC
I have two schedules:

Schedule: 2014-01-01T00:00:00/P1M
Schedule: 2013-02-01T01:00:00/P1W

When I ask when the next run is, I see:

The next scheduled run is at 2012-10-01T00:00:00Z driven by the schedule
2014-01-01T00:00:00/P1M

I can see the reverse; if I put a schedule to start in 2011, calculating the next possible time based on the interval. But this feels a bit odd, I can't schedule something to start in the future if the interval is smaller than the time in advance that I schedule it.

Comment 1 Jay Dobies 2012-09-19 16:34:57 UTC
 [
  {
    "next_run": "2012-10-01T00:00:00Z",
    "_id": "505791088a905b3b7600001a",
    "first_run": "2012-10-01T00:00:00Z",
    "schedule": "2014-01-01T00:00:00/P1M",
    "enabled": false,
    "last_run": null,
    "failure_threshold": null,
    "override_config": {},
    "remaining_runs": null,
    "consecutive_failures": 0,
    "_href": "/pulp/api/v2/repositories/ps/importers/puppet_importer/sync_schedules/505791088a905b3b7600001a/"
  },
  {
    "next_run": "2013-02-01T06:00:00Z",
    "_id": "5058c1cb8a905b059f00006c",
    "first_run": "2013-02-01T06:00:00Z",
    "schedule": "2013-02-01T01:00:00/P1W",
    "enabled": true,
    "last_run": null,
    "failure_threshold": null,
    "override_config": {},
    "remaining_runs": null,
    "consecutive_failures": 0,
    "_href": "/pulp/api/v2/repositories/ps/importers/puppet_importer/sync_schedules/5058c1cb8a905b059f00006c/"
  }
]

Comment 2 Jason Connor 2012-10-03 01:16:40 UTC
This bug is a side effect of another:
https://bugzilla.redhat.com/show_bug.cgi?id=853196

Comment 3 Jason Connor 2012-10-05 16:39:18 UTC
Merged into master in revision:
57694336ab47fa990d82dfd502038e345a8f81dc

Comment 4 Jeff Ortel 2012-10-05 21:43:08 UTC
build: 0.331

Comment 5 Preethi Thomas 2012-10-10 17:58:12 UTC
verified

[root@pulp-master ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.331-1.fc17.noarch
[root@pulp-master ~]# 


[root@pulp-master ~]# pulp-admin -u admin -p admin rpm repo sync schedules list --repo-id zoo --details
+----------------------------------------------------------------------+
                               Schedules
+----------------------------------------------------------------------+

Schedule:             2014-01-01T00:00:00/P1M
Id:                   507591bcedfc065dee000243
Enabled:              True
Remaining Runs:       N/A
Consecutive Failures: 0
Failure Threshold:    None
First Run:            2014-01-01T05:00:00Z
Last Run:             None
Next Run:             2014-01-01T05:00:00Z

Schedule:             2013-02-01T01:00:00/P1W
Id:                   507591daedfc065dee00024f
Enabled:              True
Remaining Runs:       N/A
Consecutive Failures: 0
Failure Threshold:    None
First Run:            2013-02-01T06:00:00Z
Last Run:             None
Next Run:             2013-02-01T06:00:00Z


[root@pulp-master ~]#

Comment 6 Preethi Thomas 2013-01-09 17:07:47 UTC
Pulp v2.0 released