Bug 798706 - Promotion says its complete when in fact its not
Promotion says its complete when in fact its not
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 6
Classification: Red Hat
Component: katello-agent (Show other bugs)
6.0.0
Unspecified Unspecified
low Severity medium (vote)
: Unspecified
: --
Assigned To: Justin Sherrill
Og Maciel
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-29 11:01 EST by James Laska
Modified: 2014-01-27 08:34 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-22 14:29:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Laska 2012-02-29 11:01:49 EST
Description of problem:

When promoting a changeset that included *only* distributions, it seems that the CLI command returns, even when a createrepo is still underway.  As a user, this was slightly confusing when my system was stressed after the promotion completed (due to createrepo processes pegging the CPU).

This bug is intended to track making the 'changset promote' command only return after createrepo has finished.

Version-Release number of selected component (if applicable):
 * candlepin-0.5.22-1.el6.src.rpm
 * katello-0.1.300-1.el6.src.rpm
 * katello-certs-tools-1.0.2-2.el6.src.rpm
 * katello-cli-0.1.100-2.el6.src.rpm
 * katello-configure-0.1.100-7.el6.src.rpm
 * katello-httpd-ssl-key-pair-1.0-1.src.rpm
 * katello-qpid-broker-key-pair-1.0-1.src.rpm
 * katello-selinux-0.1.7-1.el6.src.rpm
 * katello-trusted-ssl-cert-1.0-1.src.rpm
 * pulp-0.0.267-2.el6.src.rpm

Steps to Reproduce:

1. katello> changeset create --name '02 - rht distros' --environment Stage
2. katello> changeset update --name "02 - rht distros" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-i386"      
3. katello> changeset update --name "02 - rht distros" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-x86_64"
4. katello> changeset promote --name '02 - rht distros'

Actual results:

# The command returns success
Changeset [ 02 - rht distros ] promoted

# However, createrepo is still working ...
$ ps -wef | grep createrepo
apache    5913 29319  8 05:07 ?        00:03:10 /usr/bin/python -t /usr/share/createrepo/genpkgmetadata.py --database --checksum sha -g /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/x86_64/os/repodata/comps.xml --update /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/x86_64/os
apache    5922 29319  6 05:07 ?        00:02:14 /usr/bin/python -t /usr/share/createrepo/genpkgmetadata.py --database --checksum sha -g /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/i386/os/repodata/comps.xml --update /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/i386/os


Expected results:

Changeset [ 02 - rht distros ] promoted
$ ps -wef | grep createrepo
# createrepo is not running

Additional info:
Comment 1 Lukas Zapletal 2012-02-29 11:30:55 EST
As described here - promoting only distributions should not be possible.

https://bugzilla.redhat.com/show_bug.cgi?id=798709

I guess we need this BZ: Promoting a distribution without it's repo should not be possible.
Comment 2 Justin Sherrill 2012-02-29 11:41:53 EST
The real heart of this bugzilla is that when we manually regenerate the package metadata during promotion, we do not block.  As a result the promotion completes before the metadata is finished promoting.


The same situation occurs with adding a package or errata to a changeset and promoting it.  

I'll update the title accordingly.
Comment 3 Justin Sherrill 2012-02-29 11:44:25 EST
code:


def promote_content
    SNIP
    generate_metadata from_env, to_env
    SNIP
end


generate_metadata does not block like the other items in promote content which use PulpTaskStatus::wait_for_tasks to block until the tasks are complete.
Comment 4 Justin Sherrill 2012-02-29 14:07:09 EST
Errr actually this isn't really an RFE.  The promotion is saying it is complete when its not.  IMHO.
Comment 5 Lukas Zapletal 2012-03-01 08:58:35 EST
Understand, will fix this.
Comment 6 Justin Sherrill 2012-03-05 14:47:45 EST
Taking...
Comment 7 Justin Sherrill 2012-03-05 17:36:54 EST
changed promotion to block on task returned from metadata generation

93dcbb74f253e7c0d3a72bb4d93e3d6d39bf212a
Comment 9 Mike McCune 2012-03-07 18:44:28 EST
mass move ON_QA after brewing
Comment 10 Og Maciel 2012-03-08 19:51:54 EST
Validated:
* candlepin-0.5.24-1.el6.noarch
* candlepin-tomcat6-0.5.24-1.el6.noarch
* katello-0.1.303-1.el6.noarch
* katello-all-0.1.303-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.102-1.el6.noarch
* katello-cli-common-0.1.102-1.el6.noarch
* katello-common-0.1.303-1.el6.noarch
* katello-configure-0.1.104-1.el6.noarch
* katello-glue-candlepin-0.1.303-1.el6.noarch
* katello-glue-foreman-0.1.303-1.el6.noarch
* katello-glue-pulp-0.1.303-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.8-1.el6.noarch
* pulp-1.0.0-4.el6.noarch
* pulp-common-1.0.0-4.el6.noarch
* pulp-selinux-server-1.0.0-4.el6.noarch

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