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

Bug 1104320

Summary: [RFE] update pulp_worker-*.service configuration so that starting ensures all resources are initialized
Product: [Retired] Pulp Reporter: mkovacik
Component: async/tasksAssignee: pulp-bugs
Status: CLOSED UPSTREAM QA Contact: mkovacik
Severity: medium Docs Contact:
Priority: medium    
Version: 2.4 BetaCC: skarmark
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-19 01:13:37 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
Screen log of immediate repo sync call
none
journalctl screen log of the scenario
none
reproducer bash script none

Description mkovacik 2014-06-03 18:26:43 UTC
Created attachment 901871 [details]
Screen log of immediate repo sync call

Description of problem:
Currently, pulp allows requests even though the pulp_worker-*.services are not 
fully operational.
A related scenario is a repo sync request right after a pulp_worker restart, where pulp_database.available queues entries get lost from mongo and stale reservation appears in the pulp_database.reserved_resources collection.

Version-Release number of selected component (if applicable):
- Fedora 20 (systemd)
- pulp-server-2.4.0-0.19.beta.fc20.noarch

How reproducible:
~100% (on my system)

Steps to Reproduce:
1. create a rpm repo (via pulp-admin)
   pulp-admin -u admin -p admin rpm repo create --repo-id zoo --feed \
   http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
2. systemctl restart pulp_worker-{0..8}.service ; \
   pulp-admin -u admin -p admin rpm repo sync run --repo-id zoo


Actual results:
- a task queue lost even though the both the pulp_worker processes are up and running
- stale resource reservation item

  [root@ec2-79-125-97-56 ~]# fg
  mongo
  > db.available_queues.find()
  { "_id" : "reserved_resource_worker-0.compute.amazonaws.com", "last_heartbeat" : ISODate("2014-06-03T17:07:26.060Z"), "num_reservations" : 0 }
  > db.reserved_resources.find()
  { "_id" : "repository:zoo", "assigned_queue" : null, "num_reservations" : 1 }
  > db.task_status.find()
  > db.available_queues.find()
  { "_id" : "reserved_resource_worker-0.compute.amazonaws.com", "last_heartbeat" : ISODate("2014-06-03T17:08:08.281Z"), "num_reservations" : 0 }
  >

Expected results:
503 Service Unavailable Response until the pulp_worker-*.service prepare all necessary resources
i.e. Pulp server (wsgi) doesn't allow requests while pulp_worker-*.service aren't fully operational 

Additional info:

Comment 1 mkovacik 2014-06-03 18:31:42 UTC
Created attachment 901873 [details]
journalctl screen log of the scenario

Comment 2 mkovacik 2014-06-04 12:02:04 UTC
Created attachment 902159 [details]
reproducer bash script

Comment 3 Brian Bouterse 2015-02-19 01:13:37 UTC
Moved to https://pulp.plan.io/issues/235