Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 889893

Summary: Getting a lot of strange tasks created by a scheduled sync
Product: [Retired] Pulp Reporter: Steven Roberts <strobert>
Component: async/tasksAssignee: Jason Connor <jconnor>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.0.6CC: jason.dobies, jortel, mmccune, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.0.7   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-08 16:01:16 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:
Attachments:
Description Flags
mongoexport of the *_calls collections
none
pulp.log
none
output of 'pulp-admin tasks list' none

Description Steven Roberts 2012-12-23 21:17:28 UTC
Description of problem:
tried to go to automatic syncs from manual initiated ones.  noticed the machine acting a bit crazy the next morning after checking on the sync.  Saw a bunch of tasks scheduled to run instead of the 2 (sync+publish) I was expecting.

Version-Release number of selected component (if applicable):
pulp 2.0.6-0.19.rc

How reproducible:
very

Steps to Reproduce:
1. install pulp
2. configure a feed form RHN CDN for rhels6
3. schedule a sync for 11AM GMT (3am local for me)
  
Actual results:
a couple thousand (and growing) tasks created for sync run's

Expected results:
a successful sync once a day

Additional info:
I wondered if it was corrupt config/mongo since this install has lived through a number of the repo sync issues in the 2.06 beta series.  so wiped the mongo and pulp data and started from scratch.  created the repos again and then put a scheduled sync in place for the rhn-rhels6 repo.  saw the behavior again this morning.

I'll get some logs and such put together and attached to the bug shortly.  need to RDP into a work desktop and upload from there.

Comment 1 Steven Roberts 2012-12-23 21:34:50 UTC
the command I used to create the scheduled task:
pulp-admin rpm repo sync schedules create --repo-id rhn-rhels6 --schedule 2012-12-01T11:00Z/P1D

repo details:
Id: rhn-rhels6                                                          
Display Name: rhn-rhels6                                                          
Description:  None                                                                
Content Unit Count: 0 
Notes:                                                                  
Importers:                                                                        Config:                                                                               Feed URL: https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os
    Skip: drpm
  Last Sync:        None
  Repo Id:          rhn-rhels6
  Scheduled Syncs:  50d6b09c6381d3498e0005ad

Comment 2 Steven Roberts 2012-12-23 21:37:52 UTC
Created attachment 668168 [details]
mongoexport of the *_calls collections

Comment 3 Steven Roberts 2012-12-23 21:38:19 UTC
Created attachment 668169 [details]
pulp.log

Comment 4 Steven Roberts 2012-12-23 21:38:49 UTC
Created attachment 668170 [details]
output of 'pulp-admin tasks list'

Comment 5 Steven Roberts 2012-12-23 21:42:42 UTC
and output of pulp-admin schedule list:
+------------------------------------------------------------------------------------------------+
                                            Schedules
+------------------------------------------------------------------------------------------------+

Schedule:             2012-12-01T11:00Z/P1D
Id:                   50d6b09c6381d3498e0005ad
Enabled:              True
Remaining Runs:       N/A
Consecutive Failures: 0
Failure Threshold:    None
First Run:            2012-12-23T11:00:00Z
Last Run:             None
Next Run:             2012-12-23T11:00:00Z

Comment 6 Jay Dobies 2013-01-04 16:12:20 UTC
Aligning to 2.0.7 so jconnor can take a look this week.

Comment 7 Jason Connor 2013-01-09 22:12:53 UTC
fix pushed in branch jconnor-889893-scheduled-sync-collisions

Comment 8 Steven Roberts 2013-01-10 20:59:18 UTC
I in thoery:
 - applied the code patch to my local pulp server
 - cleared existing calls
   - db.archived_calls.remove()
   - db.queued_calls.remove()
   - db.scheduled_calls.remove()
 - put in a fresh schedule entry that kicked off 15 minutes ago

I am at 60 queue_calls and counting.


If I manually run db.scheduled_calls.remove() it looks to have stopped the growth.

I'm going to run a few more tests this afternoon.  see if it is something specific to the RH CDN pulls

Comment 9 Steven Roberts 2013-01-10 23:52:44 UTC
I have done a few scheduled ones against the pulp repo and it is working okay (I am seeing some non expected behavior as to when it is scheduling the next run when I update the schedule, but that I'll do as a separee bug if it ends up being one).

so not sure if it is the client https cert, that it is https or the size of the RH one.

I'll see if I can isolate a bit more.

Comment 10 Jeff Ortel 2013-01-11 20:00:39 UTC
build: 2.0.7-0.1.beta

Comment 11 Steven Roberts 2013-01-11 20:49:56 UTC
installed the beta RPM.  looking good.  and looks like I didn't grab enough of the patch before (comparing what I applied vs the new scheduler.py).

my sync that was causing db.queued_calls.count() to growth large before is now behaving.

I am seeing a LOT of the 'Schedule %(s)s skipped: last scheduled call still running' messages.  like every 30s.  so sounds like the pulp scheduler was trying to fire the task because it wasn't done yet even though it was only schedule to run say once per day.

I will let you know if it completes properly -- probably a few hours to finish.

Comment 12 Jay Dobies 2013-01-11 20:51:05 UTC
Flipping back to ON_QA, looks like bugzilla didn't resolve its "mid-air collision" correctly.

Comment 13 Preethi Thomas 2013-01-16 12:52:04 UTC
Moving to verified
[root@pulp-v2-testing ~]# rpm -q pulp-server
pulp-server-2.0.7-0.1.beta.noarch
[root@pulp-v2-testing ~]# 

[root@pulp-v2-testing ~]# pulp-admin rpm repo sync schedules list --repo-id rhn-rhels6 
+----------------------------------------------------------------------+
                               Schedules
+----------------------------------------------------------------------+

Schedule: 2013-01-15T09:00Z/P1D
Id:       50f575804a4d38671b0000dd
Enabled:  True
Last Run: 2013-01-15T15:30:00Z
Next Run: 2013-01-16T15:30:00Z


[root@pulp-v2-testing ~]# pulp-admin tasks list
+----------------------------------------------------------------------+
                                 Tasks
+----------------------------------------------------------------------+

Operations:  profile_create
Resources:   f17-client (consumer), rpm (content_unit)
State:       Successful
Start Time:  2013-01-16T08:50:30Z
Finish Time: 2013-01-16T08:50:30Z
Result:      ****
Task Id:     02fee600-38c4-4920-87bc-89299cd68e2c


[root@pulp-v2-testing ~]#

Comment 14 Steven Roberts 2013-01-16 17:53:45 UTC
Agree on the verified... fyi though the key is that when the scheduled task runs it doesn't end up making thousands of tasks not just when the schedule gets created.

Comment 15 Preethi Thomas 2013-04-08 16:01:16 UTC
Pulp 2.1 released 


http://www.pulpproject.org/2013/04/05/pulp-2-1-0-released/