Description of problem: subscription-manager plugin regenerates the redhat.repo file every run, even if nothing has changed. yum sees that the repofile is newer than the cached download of the metadata, and so does the network checks (Eg. baseurl/etc. could have changed). This is a huge performance hit (as local operations have to connect to the network). Version-Release number of selected component (if applicable): subscription-manager-1.8.22-1.el6_4 Steps to Reproduce: Run: time yum list yum time yum list yum --disableplugin=subscription-manager Fix: The simplest thing to do is write to redhat.repo.tmp, and then if redhat.repo is the same size compare the bytes and unlink or rename based on if they are the same.
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
commit 5ea458dd3fed6414758ff9a8c785ba33b81f8918 Author: ckozak <ckozak> Date: Wed May 21 13:51:58 2014 -0400 1035440: Don't rewrite redhat.repo unless it has changed
Demonstrating this bug on version... [root@jsefler-5 ~]# subscription-manager version server type: This system is currently not registered. subscription management server: 0.9.10.2-1 subscription-manager: 1.11.3-2.el5 python-rhsm: 1.11.3-2.el5 After registering and attaching a subscription... [root@jsefler-5 ~]# cat /etc/yum.repos.d/redhat.repo > /tmp/redhat.repo.A [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 10:01:13.000000000 -0400 [root@jsefler-5 ~]# yum -q repolist --enableplugin subscription-manager This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 10:02:44.000000000 -0400 [root@jsefler-5 ~]# yum -q repolist --enableplugin subscription-manager This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 10:03:29.000000000 -0400 [root@jsefler-5 ~]# yum -q repolist --enableplugin subscription-manager This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 10:03:47.000000000 -0400 [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 10:03:47.000000000 -0400 [root@jsefler-5 ~]# cat /etc/yum.repos.d/redhat.repo > /tmp/redhat.repo.B [root@jsefler-5 ~]# diff /tmp/redhat.repo.A /tmp/redhat.repo.B [root@jsefler-5 ~]# In the above test, you will notice that the time of last modification to the redhat.repo file changes every time the yum subscription-manager plugin is triggered by calling yum repolist. Yet the contents of the redhat.repo file show no difference before and after all of the modification time stamps. Clearly we are re-writing the redhat.repo file unnecessarily.
Verifying fixed subscription-manager version... [root@jsefler-5 ~]# subscription-manager version server type: This system is currently not registered. subscription management server: 0.9.12-1 subscription-manager: 1.11.3-5.el5 python-rhsm: 1.11.3-3.el5 After registering and attaching a subscription... [root@jsefler-5 ~]# cat /etc/yum.repos.d/redhat.repo > /tmp/redhat.repo.A [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 11:36:30.000000000 -0400 [root@jsefler-5 ~]# yum -q repolist --enableplugin subscription-manager This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 11:36:30.000000000 -0400 [root@jsefler-5 ~]# yum -q repolist --enableplugin subscription-manager This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 11:36:30.000000000 -0400 [root@jsefler-5 ~]# yum -q clean all --enableplugin subscription-manager [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 11:36:30.000000000 -0400 [root@jsefler-5 ~]# yum list --enableplugin subscription-manager > /dev/null This system is not registered with RHN Classic or RHN Satellite. You can use rhn_register to register. RHN Satellite or RHN Classic support will be disabled. [root@jsefler-5 ~]# stat -c %y /etc/yum.repos.d/redhat.repo 2014-06-03 11:36:30.000000000 -0400 [root@jsefler-5 ~]# cat /etc/yum.repos.d/redhat.repo > /tmp/redhat.repo.B [root@jsefler-5 ~]# diff /tmp/redhat.repo.A /tmp/redhat.repo.B [root@jsefler-5 ~]# In the above verification, you will notice that the time of last modification to the redhat.repo file remains the same every time the yum subscription-manager plugin is triggered by calling yum. This is because the redhat.repo file is no longer being re-written unnecessarily during execution of the yum subscription-manager plugin. Moving to VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1225.html