Bug 1931872 - dnf fails when another instance runs in parallel (cache is removed)
Summary: dnf fails when another instance runs in parallel (cache is removed)
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-23 13:01 UTC by Flavio Leitner
Modified: 2023-08-16 16:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-06 12:36:06 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 7029047 0 None None None 2023-08-16 16:46:30 UTC

Internal Links: 2132375

Description Flavio Leitner 2021-02-23 13:01:49 UTC
Description of problem:

When two 'dnf' instances are running in parallel, the cache is unprotected leading the second instance waiting to fail.

shell #1
# dnf install vim-enhanced

shell #2
# dnf install vim-enhanced


shell #1
- downloads the dependencies, installs and verifies the deps.

shell #2
- notices the downloads are there, waits shell #1 to complete, then fails.


Version-Release number of selected component (if applicable):
dnf-4.2.23-4.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Just install the same package using two dnf in parallel

Actual results:
[SKIPPED] pkgconf-1.4.2-1.el8.x86_64.rpm: Already downloaded                                              
[SKIPPED] pkgconf-m4-1.4.2-1.el8.noarch.rpm: Already downloaded                                           
[SKIPPED] pkgconf-pkg-config-1.4.2-1.el8.x86_64.rpm: Already downloaded                                   
[SKIPPED] xml-common-0.6.3-50.el8.noarch.rpm: Already downloaded                                          
Running transaction check                                                                                 
Waiting for process with pid 27640 to finish.                    
Transaction check succeeded.                                                                              
Running transaction test                                  
Error: Cannot open file /var/cache/dnf/beaker-AppStream-822659b7f413e82c/packages/pixman-0.38.4-1.el8.x86_6
4.rpm: [Errno 2] No such file or directory: '/var/cache/dnf/beaker-AppStream-822659b7f413e82c/packages/pixm
an-0.38.4-1.el8.x86_64.rpm'                                                                               
TypeError: an integer is required (got type NoneType)                                                     
FATAL ERROR: python callback ??? failed, aborting! 

Expected results:
To proper synchronize the threads.

Additional info:

The example above is a simplified case to make an easy reproducer.

The real use-case is that there is a daemon installed by Beaker that install packages (rstrnt-package) and that happens while the CI is accessing the server to deploy all the dependencies. That problem always happen when the dependencies coincides.

I can imagine another use case that the user could install something using CLI while the package updater is upgrading as well.

Comment 1 Jaroslav Mracek 2022-04-06 12:36:06 UTC
I am really sorry but the issue is very difficult to resolve it in current code base. But we would like to address the issue in the next major packager update that is planned for RHEL10.


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