Bug 1124316 - [locking] per-installroot metadata lock
[locking] per-installroot metadata lock
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jan Zeleny
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-29 04:33 EDT by Michael Simacek
Modified: 2015-10-13 02:52 EDT (History)
6 users (show)

See Also:
Fixed In Version: dnf-0.6.2 dnf-0.6.4-7.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-13 02:52:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Simacek 2014-07-29 04:33:50 EDT
Description of problem:
When DNF downloads cache it always locks the global metadata-cache lock even though different cachedir is used.  This is a problem with mock, because then you can't run multiple builds that refresh repos at the same time. The same problem applies to package-cache.

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

Expected results:
Each cache locked independently
Comment 1 Ales Kozumplik 2014-07-29 09:09:06 EDT
Hello Michal,

can you please describe steps taken to reproduce this and the actual results seen? How is mock setting the different cachedir?

Thanks!
Comment 2 Michael Simacek 2014-07-29 10:45:25 EDT
Reproducer outside mock:
mkdir -p /tmp/buildroot/etc/dnf
cat > /tmp/buildroot/etc/dnf/dnf.conf << EOF
[main]
reposdir=/dev/null
gpgcheck=0
assumeyes=1
syslog_ident=mock
keepcache=1

[fedora-mock]
name=fedora-mock
baseurl=http://mirror.vutbr.cz/fedora/development/rawhide/x86_64/os
EOF
sudo dnf --installroot /tmp/buildroot --releasever 22 install shadow-utils


in another terminal:
sudo dnf makecache

output:
metadata-cache already locked by 31676
  The application with PID 31676 is: dnf
    Memory :  25 M RSS (576 MB VSZ)
    Started: Tue Jul 29 16:33:16 2014 - 00:26 ago
    State  : Sleeping

The instance with installroot specified writes the cache into /tmp/buildroot/var/cache/dnf, which is correct. But locks everything globally. The global cache and the one in installroot should be completely independent. The problem I'm hitting in mock is that each running instance of mock will have different installroot and therefore different cache, but only one of them will acquire the lock, others will exit.

The same problem applies when cachedir is explicitly overriden in the config.
Comment 3 Ales Kozumplik 2014-07-30 01:18:32 EDT
Thanks Michal, it' s clear now. We'll take a look at this.
Comment 4 Ales Kozumplik 2014-09-09 05:31:42 EDT
Looking.
Comment 5 Ales Kozumplik 2014-09-09 10:27:40 EDT
Fixed upstream by 45b26c6, the lock files are now stored at more reasonable places and do not clash for different caches.
Comment 7 Fedora Update System 2014-10-05 13:42:00 EDT
dnf-0.6.2-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/dnf-0.6.2-1.fc21
Comment 8 Fedora Update System 2014-10-06 01:03:37 EDT
Package dnf-0.6.2-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.6.2-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12254/dnf-0.6.2-1.fc21
then log in and leave karma (feedback).
Comment 9 Jaroslav Reznik 2015-03-03 12:18:51 EST
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
Comment 10 Honza Silhan 2015-07-20 07:07:58 EDT
wasn't properly closed by Fedora Update System.
Comment 11 Fedora Update System 2015-08-28 14:54:00 EDT
dnf-0.6.4-6.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14323
Comment 12 Fedora Update System 2015-09-29 07:19:21 EDT
dnf-0.6.4-7.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-9bcdcdc46b
Comment 13 Fedora Update System 2015-10-02 14:52:19 EDT
dnf-0.6.4-7.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-9bcdcdc46b
Comment 14 Fedora Update System 2015-10-13 02:52:17 EDT
dnf-0.6.4-7.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

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