Bug 1124316 - [locking] per-installroot metadata lock
Summary: [locking] per-installroot metadata lock
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Zeleny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-29 08:33 UTC by Michael Simacek
Modified: 2015-10-13 06:52 UTC (History)
6 users (show)

Fixed In Version: dnf-0.6.2 dnf-0.6.4-7.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-13 06:52:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael Simacek 2014-07-29 08:33:50 UTC
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 13:09:06 UTC
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 14:45:25 UTC
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 05:18:32 UTC
Thanks Michal, it' s clear now. We'll take a look at this.

Comment 4 Ales Kozumplik 2014-09-09 09:31:42 UTC
Looking.

Comment 5 Ales Kozumplik 2014-09-09 14:27:40 UTC
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 17:42:00 UTC
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 05:03:37 UTC
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 17:18:51 UTC
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 11:07:58 UTC
wasn't properly closed by Fedora Update System.

Comment 11 Fedora Update System 2015-08-28 18:54:00 UTC
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 11:19:21 UTC
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 18:52:19 UTC
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 06:52:17 UTC
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.