Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1593331

Summary: Concurrent use of repoclosure breaks
Product: Red Hat Enterprise Linux 7 Reporter: Ewoud Kohl van Wijngaarden <ekohlvan>
Component: yum-utilsAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: kwalker, mdomonko, packaging-team-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-03 14:06:29 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:

Description Ewoud Kohl van Wijngaarden 2018-06-20 14:59:40 UTC
Description of problem:

In our CI we run repoclosure in parallel. We run it as a non-root user and all processes use the same cache directory in /var/tmp. The problem is that one repoclosure can delete the cache of another.

Suppose 2 process both have a repo named el7-epel and process 1 is done using it. Then it removes the cache, but process 2 could still be using it.

There is no way to force every process to use their own cache (other than doing filesystem tricks). It uses the getCacheDir() function from yum.misc but there's no way to pass in reuse=False to disable the problematic behavior.

Version-Release number of selected component (if applicable):

Seen in the latest in EL7 (yum-utils-1.1.31.45.el7) but probably present in all versions.


How reproducible:

Since it's a sort of race condition, it isn't 100% reproducible but it's pretty easy if you increase the concurrency.


Steps to Reproduce:
1. Start a number of repoclosure processes that use the same repositories in parallel. 

Actual results:

Sometimes you get errors like:

Traceback (most recent call last):
  File "/usr/bin/repoclosure", line 306, in <module>
    main()
  File "/usr/bin/repoclosure", line 260, in main
    my.readMetadata()
  File "/usr/bin/repoclosure", line 112, in readMetadata
    self.doRepoSetup()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 681, in doRepoSetup
    return self._getRepos(thisrepo, True)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 721, in _getRepos
    self._repos.doSetup(thisrepo)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 157, in doSetup
    self.retrieveAllMD()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 88, in retrieveAllMD
    dl = repo._async and repo._commonLoadRepoXML(repo)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1506, in _commonLoadRepoXML
    self._revertOldRepoXML()
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1334, in _revertOldRepoXML
    os.rename(old_data['old_local'], old_data['local'])
OSError: [Errno 2] No such file or directory

Expected results:

Normal execution.

Additional info:

Comment 2 Karel Srot 2018-11-12 07:14:58 UTC
You could run each repoclosure under a different/new user account.