Bug 798706 - Promotion says its complete when in fact its not
Summary: Promotion says its complete when in fact its not
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Og Maciel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-29 16:01 UTC by James Laska
Modified: 2019-09-26 15:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:29:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description James Laska 2012-02-29 16:01:49 UTC
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 16:30:55 UTC
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 16:41:53 UTC
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 16:44:25 UTC
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 19:07:09 UTC
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 13:58:35 UTC
Understand, will fix this.

Comment 6 Justin Sherrill 2012-03-05 19:47:45 UTC
Taking...

Comment 7 Justin Sherrill 2012-03-05 22:36:54 UTC
changed promotion to block on task returned from metadata generation

93dcbb74f253e7c0d3a72bb4d93e3d6d39bf212a

Comment 9 Mike McCune 2012-03-07 23:44:28 UTC
mass move ON_QA after brewing

Comment 10 Og Maciel 2012-03-09 00:51:54 UTC
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.