Bug 757825 - sync with schedules doesn't return the sync progress of currently syncing
Summary: sync with schedules doesn't return the sync progress of currently syncing
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 30
Assignee: Jason Connor
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On: 772350
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-28 19:15 UTC by Preethi Thomas
Modified: 2014-03-31 01:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-24 20:10:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2011-11-28 19:15:22 UTC
Description of problem:
If a repo has a sync with schedule and its syncing at the time you check the status, the sync sync progress is shown as unknown

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


How reproducible:


Steps to Reproduce:
1. create a repo and set a sync schedule
2. check the sync status at the time that the sync is set
3.
  
Actual results:
[root@preethi ~]# pulp-admin repo status --id=f16
+------------------------------------------+
               Status for f16
+------------------------------------------+
Repository: f16
Number of Packages: 3107
Last Sync: 2011-11-28 14:11:55-05:00
Currently syncing: progress unknown


Expected results:


Additional info:

Comment 1 Jason Connor 2011-12-20 17:01:00 UTC
I fixed this a while back, verified fix.

Comment 2 Jeff Ortel 2012-01-04 21:48:36 UTC
build: 0.256

Comment 3 Preethi Thomas 2012-01-06 19:08:52 UTC
fails_qa
[root@preethi ~]# pulp-admin repo sync --id=f15 --interval PT5M --start=2012-01-07T14:00:00:00
Sync schedule for repo [ f15 ] changed to [ 2012-01-07T14:00:00/PT5M ]

[root@preethi ~]# pulp-admin repo status --id=f15+------------------------------------------+
               Status for f15
+------------------------------------------+
Repository: f15
Number of Packages: 2935
Last Sync: 2012-01-04 15:04:30-05:00
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 23, in <module>
    admin.main()
  File "/usr/lib/python2.7/site-packages/pulp/client/lib/cli.py", line 152, in main
    command.main(self.args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 129, in main
    action.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 213, in main
    self.run()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/repo.py", line 315, in run
    error_details = self.form_error_details(syncs[0]["progress"])
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/repo.py", line 153, in form_error_details
    if not progress.has_key("error_details"):
AttributeError: 'NoneType' object has no attribute 'has_key'

Comment 4 Jason Connor 2012-01-09 17:48:39 UTC
unblocked by commit c54587e29439ef2eaf9dd6d5dceeeacaaf4ced61

Comment 5 Jeff Ortel 2012-01-10 16:33:29 UTC
build: 0.257

Comment 6 Preethi Thomas 2012-01-10 19:41:53 UTC
fails_qa
[root@preethi ~]# rpm -q pulp
pulp-0.0.257-1.fc15.noarch

the progress shows as progress unknown if you run repo status at the time its syncing. But once its done it seem to returning the status

so the steps to reproduce (from my comment above)

1. Create a repo 
2. Run repo sync with schedule (eg I have a schedule    	2012-01-10T14:00:00-05:00/PT5M)

3. At the time that the repo is scheduled to sync ( so at    	2012-01-10T14:00:00-05:00/PT5M) run repo status

see this

[root@preethi ~]# pulp-admin -u admin -p admin repo status --id=centos
+------------------------------------------+
              Status for centos
+------------------------------------------+
Repository: centos
Number of Packages: 6294
Last Sync: 2012-01-10 14:31:35-05:00
Currently syncing: progress unknown

Comment 7 Jason Connor 2012-01-17 22:43:58 UTC
the progress callback was being eliminated on the second call by the task history mechanism
the fix requires the following two commits:
428960971592a3a5b615b513f6fd93fd69f35f2c
0bf928815823b5eb46df48c0b0119059ccf228bc

Comment 8 Jeff Ortel 2012-01-21 00:22:56 UTC
build: 0.259

Comment 9 Preethi Thomas 2012-02-07 17:33:43 UTC
fails_qa
[root@pulp-f16 ~]# rpm -q pulp
pulp-0.0.264-1.fc16.noarch
[root@pulp-f16 ~]# 

if you get the status while the scheduled sync is running i can the progress as Progress Unknown

[root@pulp-f16 ~]# pulp-admin repo status --id=test +------------------------------------------+
               Status for test
+------------------------------------------+
Repository: test
Number of Packages: 20
Last Sync: 2012-02-07 12:25:10-05:00
Currently syncing: progress unknown

Comment 10 Jason Connor 2012-02-07 22:54:51 UTC
Preethi, I can't reproduce this. Can you give me let me know how you have your test repository setup?

== OUTPUT == 

[jconnor@localhost pulp]$ pulp-admin task list
Task: ef2293c0-51dd-11e1-86ca-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: cull_history
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-08T08:00:00Z
    Result: None
    Exception: None
    Traceback: None

Task: 2dcd93ca-51de-11e1-a17e-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: _sync
    Arguments: kernel
    State: running
    Start time: 2012-02-07T15:52:52-07:00
    Finish time: None
    Scheduled time: 2012-02-07T22:52:49Z
    Result: None
    Exception: None
    Traceback: None

Task: ef227c63-51dd-11e1-86ca-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: cull_audited_events
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-08T20:00:00Z
    Result: None
    Exception: None
    Traceback: None


[jconnor@localhost pulp]$ pulp-admin repo status --id kernel
+------------------------------------------+
              Status for kernel
+------------------------------------------+
Repository: kernel
Number of Packages: 24
Last Sync: 2012-02-07 15:51:27-07:00
Currently syncing: Downloading Items or Verifying (16 of 24 items downloaded. 151693276.0 bytes remaining)

[jconnor@localhost pulp]$ pulp-admin repo status --id kernel
+------------------------------------------+
              Status for kernel
+------------------------------------------+
Repository: kernel
Number of Packages: 24
Last Sync: 2012-02-07 15:51:27-07:00
Currently syncing: Running Createrepo (24 of 24 items downloaded. 0.0 bytes remaining)

Comment 11 Jason Connor 2012-02-07 22:58:35 UTC
Even after rebooting:

== OUTPUT ==


[jconnor@localhost pulp]$ pulp-admin task list
Task: c747de35-51de-11e1-8f53-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: cull_audited_events
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-08T20:00:00Z
    Result: None
    Exception: None
    Traceback: None

Task: c747fe66-51de-11e1-8f53-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: cull_history
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-08T08:00:00Z
    Result: None
    Exception: None
    Traceback: None

Task: 2dcd93ca-51de-11e1-a17e-525400fdc2eb
    Job: None
    Scheduler: immediate
    Call: _sync
    Arguments: kernel
    State: finished
    Start time: 2012-02-07T15:55:06-07:00
    Finish time: 2012-02-07T15:55:37-07:00
    Scheduled time: None
    Result: True
    Exception: None
    Traceback: None

Task: c748b3d9-51de-11e1-8f58-525400fdc2eb
    Job: None
    Scheduler: interval
    Call: _sync
    Arguments: kernel
    State: running
    Start time: 2012-02-07T15:57:26-07:00
    Finish time: None
    Scheduled time: 2012-02-07T15:57:25-07:00
    Result: None
    Exception: None
    Traceback: None


[jconnor@localhost pulp]$ pulp-admin repo status --id kernel
+------------------------------------------+
              Status for kernel
+------------------------------------------+
Repository: kernel
Number of Packages: 24
Last Sync: 2012-02-07 15:55:37-07:00
Currently syncing: Running Createrepo (24 of 24 items downloaded. 0.0 bytes remaining)

Comment 12 Preethi Thomas 2012-02-08 14:20:45 UTC
Not exactly sure what triggers it. But the following steps seems to be good reproducer

1. change the schedule for repo sync
2.  tail the log so that you know for sure the scheduled sync is kicked off.
3. As soon as the sync starts run repo status for the repo.

[root@katello-test ~]# pulp-admin -u admin -p admin repo status --id=spacewalk
+------------------------------------------+
            Status for spacewalk
+------------------------------------------+
Repository: spacewalk
Number of Packages: 85
Last Sync: 2012-02-08 09:09:12-05:00

[root@katello-test ~]# pulp-admin -u admin -p admin repo status --id=spacewalk
+------------------------------------------+
            Status for spacewalk
+------------------------------------------+
Repository: spacewalk
Number of Packages: 85
Last Sync: 2012-02-08 09:09:12-05:00
Currently syncing: progress unknown

[root@katello-test ~]# pulp-admin -u admin -p admin task list
Task: 52f55e21-522c-11e1-8347-54520065b6c1
    Job: None
    Scheduler: interval
    Call: cull_audited_events
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-08T18:00:00Z
    Result: None
    Exception: None
    Traceback: None

Task: 52f59c00-522c-11e1-8349-54520065b6c1
    Job: None
    Scheduler: interval
    Call: cull_history
    Arguments: 
    State: waiting
    Start time: None
    Finish time: None
    Scheduled time: 2012-02-09T06:00:00Z
    Result: None
    Exception: None
    Traceback: None

Task: 5366b9cf-522c-11e1-862e-54520065b6c1
    Job: None
    Scheduler: interval
    Call: _sync
    Arguments: spacewalk
    State: running
    Start time: 2012-02-08T09:14:02-05:00
    Finish time: None
    Scheduled time: 2012-02-08T14:14:00Z
    Result: None
    Exception: None
    Traceback: None


[root@katello-test ~]#

Comment 13 Jason Connor 2012-02-10 21:10:09 UTC
Sayli pushed the fix for this in revision: 1bbb2836d7361fd6aa7e01250003da4d8742d786

Comment 14 Jeff Ortel 2012-02-13 16:38:32 UTC
build: 0.266

Comment 15 Preethi Thomas 2012-02-23 03:27:03 UTC
verified

[root@katello-test ~]# pulp-admin repo status --id=pulp
+------------------------------------------+
               Status for pulp
+------------------------------------------+
Repository: pulp
Number of Packages: 17
Last Sync: 2012-02-22 22:26:15-05:00
Currently syncing: Downloading Metadata (0 of 0 items downloaded. 0.0 bytes remaining)

[root@katello-test ~]# pulp-admin repo status --id=pulp
+------------------------------------------+
               Status for pulp
+------------------------------------------+
Repository: pulp
Number of Packages: 17
Last Sync: 2012-02-22 22:26:15-05:00
Currently syncing: Running Createrepo (17 of 17 items downloaded. 0.0 bytes remaining)

Comment 16 Preethi Thomas 2012-02-24 20:10:58 UTC
Pulp v1.0 is released
Closed Current Release.


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