RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1787197 - rhsmcertd-worker fires as many RHSM queries as number of enabled repos
Summary: rhsmcertd-worker fires as many RHSM queries as number of enabled repos
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.1
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.1
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-01 11:05 UTC by Pavel Moravec
Modified: 2023-09-07 21:21 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-10 10:13:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2204 0 None closed 1741183: Yum loaded subscription-manager plugin multiple times 2021-02-04 06:42:49 UTC
Red Hat Issue Tracker RHELPLAN-31825 0 None None None 2022-05-02 04:36:57 UTC

Description Pavel Moravec 2020-01-01 11:05:51 UTC
Description of problem:
Having many repos enabled on a system, various RHSM tasks take longer - linearly to the number of enabled repos (even custom ones). Particular tasks/requests that take longer:

(*) rhsmcertd-worker doing certs check (by default, every 4hours)
(*) subscription-manager repos --list
(*) subscription-manager repos --[enable|disable]=..
(*) subscription-manager attach --pool=..

For _each_ enabled repo, below requests are raised:

1.2.3.4 - - [01/Jan/2020:11:46:50 +0100] "GET /rhsm/consumers/a396bdc4-ed28-402d-831b-96d8cae1b0ae/certificates/serials HTTP/1.1" 200 63 "-" "RHSM/1.0 (cmd=rhsmcertd-worker)"
1.2.3.4 - - [01/Jan/2020:11:46:50 +0100] "GET /rhsm/status HTTP/1.1" 200 377 "-" "RHSM/1.0 (cmd=rhsmcertd-worker)"
1.2.3.4 - - [01/Jan/2020:11:46:50 +0100] "GET /rhsm/consumers/a396bdc4-ed28-402d-831b-96d8cae1b0ae HTTP/1.1" 200 22271 "-" "RHSM/1.0 (cmd=rhsmcertd-worker)"
1.2.3.4 - - [01/Jan/2020:11:46:50 +0100] "GET /rhsm/consumers/a396bdc4-ed28-402d-831b-96d8cae1b0ae/content_overrides HTTP/1.1" 200 2980 "-" "RHSM/1.0 (cmd=rhsmcertd-worker)"
1.2.3.4 - - [01/Jan/2020:11:46:50 +0100] "GET /rhsm/consumers/a396bdc4-ed28-402d-831b-96d8cae1b0ae/release HTTP/1.1" 200 19 "-" "RHSM/1.0 (cmd=rhsmcertd-worker)"


Having 50 repos enabled, 50 such bunches of requests are made. Invoking those requests by thousands of clients then generates redundantly high load to Satellite (as well as to our customer portal candlepin instance).

RHSM (subscription-manager / rhsmcertd / .. programs) should rather cache the data during one invocation since the very first query, and re-use the information.


Version-Release number of selected component (if applicable):
Sat6.6.1 / subscription-manager-rhsm-1.24.13-3.el7_7.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Create 10+ custom products and repos.
2. Enable all of them (plus some Red Hat repo) on a client system
3. Run either command:
rhsmcertd-worker   ( or wait for the automated certs check itself)
subscription-manager repos --list
subscription-manager repos --[enable|disable]=..
subscription-manager attach --pool=..

4. meanwhile, check requests made against Satellite:

tail -f /var/log/httpd/foreman-ssl_access_ssl.log



Actual results:
The five requests enumerated above will be fired against Satellite as many times as the number of enabled repos is.


Expected results:
Ideally, there should be just one such bunch of requests.


Additional info:
This is rather RHEL/rhsm bug / improvement request, though it mainly affects Satellite customers - let engineering decides proper product and component.

Comment 9 Jiri Hnidek 2020-01-27 16:57:49 UTC
I can confirm that this bug has been already fixed here: https://bugzilla.redhat.com/show_bug.cgi?id=1741183

The #1741183 is already in ON_QA state.

Comment 12 Pavel Moravec 2020-02-10 10:11:02 UTC
Backport to RHEL8 is _not_ needed as this BZ affects yum systems but not dnf ones.


This does not happen in RHEL8 / on dnf systems, as dnf must cache its config somehow. Cf the fix

https://github.com/candlepin/subscription-manager/pull/2204/files

and mimic the underlying calls manually.

On RHEL7 when I run a python script:

import yum
yb = yum.YumBase()
yb.conf

(what exactly _obtain_mappings_yum did before the patch), then:
1) I see "Loaded plugins: product-id, subscription-manager" (cf. the bz1741183 complaint)
2) the latest call "yb.conf" triggers 5 requests against RHSM server (to URIs for /rhsm/, /rhsm/status, and for consumer serials, content_overrides + release)

This is executed for each repo enabled when running my reproducer.


On RHEL8 when I run python script:

import dnf
db = dnf.dnf.Base()
db.conf

then no requests are raised against RHSM server, at all.

This means that both this bz1787197 and bz1741183 are applicable to yum systems but not dnf systems.



So the backport of bz1741183 fix to RHEL8 is not required.

Comment 13 Pavel Moravec 2020-02-10 10:13:37 UTC
Due to the above statement, no bug on RHEL8 (while RHEL7 is tracked under 1741183). So closing this as NOTABUG (on rhel8).


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