Bug 1931872

Summary: dnf fails when another instance runs in parallel (cache is removed)
Product: Red Hat Enterprise Linux 8 Reporter: Flavio Leitner <fleitner>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DEFERRED QA Contact: swm-qe
Severity: high Docs Contact:
Priority: high    
Version: 8.3CC: amatej, james.antill, jcastran
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-06 12:36:06 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 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.