Bug 798772 - Disconnect between pulp and katello sync tasks in terms of date format
Summary: Disconnect between pulp and katello sync tasks in terms of date format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Og Maciel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-29 20:06 UTC by Og Maciel
Modified: 2019-09-26 15:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 18:54:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0665 0 normal SHIPPED_LIVE new packages: katello 2012-05-15 22:27:22 UTC

Description Og Maciel 2012-02-29 20:06:10 UTC
Description of problem:

Created a planned hourly sync task to start $TODAY at 13:45 and associated it with an existing custom repository. As I was watching pulp.log, the following output caught my attention:

2012-02-29 13:18:17,923 12376:140266811930368: pulp:WARNING: scheduler:122 IntervalScheduler created with start time more than one interval in the past: 2012-02-29 08:45:00-05:00, 1:00:00
2012-02-29 13:18:18,004 12376:140266811930368: pulp.server.tasking.task:WARNING: task:376 Task c0d28d19-6301-11e1-89a8-525400a4beb2: _sync(SaoPaulo-SystemEngine-Hourly, synchronizer=<pulp.server.api.synchronizers.YumSynchronizer object at 0x7f924f90f290>, progress_callback=<bound method RepoSyncTask.progress_callback of <pulp.server.api.repo_sync_task.RepoSyncTask object at 0x7f9254ae1050>>) missed 4 scheduled runs

Based on this output, it seems to me that pulp interpreted 13:45 as 08:45am -05:00 and notified that 4 scheduled runs were missed. The task eventually ran at the correct time, but after talking to a few people, we decided that this is worth investigating.

Version-Release number of selected component (if applicable):

* candlepin-0.5.22-1.el6.noarch
* candlepin-tomcat6-0.5.22-1.el6.noarch
* katello-0.1.300-1.el6.noarch
* katello-all-0.1.300-1.el6.noarch
* katello-certs-tools-1.0.2-2.el6.noarch
* katello-cli-0.1.100-2.el6.noarch
* katello-cli-common-0.1.100-2.el6.noarch
* katello-common-0.1.300-1.el6.noarch
* katello-configure-0.1.100-7.el6.noarch
* katello-glue-candlepin-0.1.300-1.el6.noarch
* katello-glue-foreman-0.1.300-1.el6.noarch
* katello-glue-pulp-0.1.300-1.el6.noarch
* katello-httpd-ssl-key-pair-1.0-1.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-repos-0.1.5-1.el6.noarch
* katello-selinux-0.1.7-1.el6.noarch
* katello-trusted-ssl-cert-1.0-1.noarch
* pulp-0.0.267-2.el6.noarch
* pulp-admin-0.0.267-2.el6.noarch
* pulp-client-lib-0.0.267-2.el6.noarch
* pulp-common-0.0.267-2.el6.noarch
* pulp-selinux-server-0.0.267-2.el6.noarch

How reproducible:


Steps to Reproduce:
1. Create an hourly sync plan to start in the very short term future (30 minutes from when you create it should be fine)
2. Associate an existing repository with it and save
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Og Maciel 2012-03-01 21:47:38 UTC
Task creation was done via web ui

Comment 3 Justin Sherrill 2012-03-09 14:30:16 UTC
Looks like we weren't considering time zone whatsoever sadly.  Made changes to set it in the model as local time.  It gets saved to our database as UTC, so we also have to convert it back to locatime for display.

katello master:  03ebd42de82298a04a08d7ee4fd5d6baee0961eb

Comment 5 Ivan Necas 2012-03-12 12:38:18 UTC
Fixed additional problems introduced in previous commit
bd0c5564e35a10dfa1aba0600a7bcdbbfa4411a0

This code was used to convert UTC to local timezone:

    self.sync_date.to_time.in_time_zone(Time.now.zone).to_datetime

Two problems are with it:

   1. current timezone is used (which might be different from the time the sync
      plan was created)

   2. for some timezones (e.g. EDT, which we turned on east cost today) this line fails with
        undefined method `period_for_utc' for nil:NilClass

Replacing with:

    self.sync_date.localtime.to_datetime

Comment 8 Og Maciel 2012-03-16 22:38:09 UTC
Justin, could you provide me with steps to validate this? There were no messages displayed in pulp.log this time, so I assume I need to extract data from a database?

Thanks in advance, Og

Comment 9 Justin Sherrill 2012-03-19 13:24:24 UTC
Hey Og,

Couple ways to test it, I would do both :)


1.  Apply a Sync Schedule, make sure sync happens when it should.
2.  Use pulp-admin to check the set sync schedule.  They should be on the repo object themselves, so something like:

  pulp-admin auth login --username=foo --password=bar
  pulp-admin repo list

find the repo in the product you applied it to, and look for "Sync Schedule"

Comment 10 Og Maciel 2012-03-19 14:52:38 UTC
Verified:
* candlepin-0.5.26-1.el6.noarch
* candlepin-tomcat6-0.5.26-1.el6.noarch
* katello-0.1.304-1.el6.noarch
* katello-all-0.1.304-1.el6.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.0.4-1.el6.noarch
* katello-cli-0.1.105-1.el6.noarch
* katello-cli-common-0.1.105-1.el6.noarch
* katello-common-0.1.304-1.el6.noarch
* katello-configure-0.1.106-1.el6.noarch
* katello-glue-candlepin-0.1.304-1.el6.noarch
* katello-glue-foreman-0.1.304-1.el6.noarch
* katello-glue-pulp-0.1.304-1.el6.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-0.1.9-1.el6.noarch
* pulp-1.0.0-5.el6.noarch
* pulp-admin-1.0.0-5.el6.noarch
* pulp-client-lib-1.0.0-5.el6.noarch
* pulp-common-1.0.0-5.el6.noarch
* pulp-selinux-server-1.0.0-5.el6.noarch

Comment 11 errata-xmlrpc 2012-05-15 18:54:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0665.html


Note You need to log in before you can comment on or make changes to this bug.