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 - Concurrent use of repoclosure breaks
Summary: Concurrent use of repoclosure breaks
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-20 14:59 UTC by Ewoud Kohl van Wijngaarden
Modified: 2019-01-03 14:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-03 14:06:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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