Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 230469

Summary: portage --fetchonly should not wait for lockfiles
Product: Gentoo Linux Reporter: Walter <walter>
Component: New packagesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement Keywords: InVCS
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 216231    

Description Walter 2008-07-02 07:05:51 UTC
Portage should not wait for lockfiles when run in --fetchonly mode

I understand that fetching the same package in parallel might be a bad idea, however this could be resolved by checking to see if the file is currently open (lsof style) or by using a package-version.tar.gz.lock file with the PID for the portage process (allowing auto detection/removal of old or dead locks).

Reproducible: Always

Steps to Reproduce:
1. emerge gnome (in one VT)
2. emerge --fetchonly mysql (in another VT)

Actual Results:  
during some gnome package compile (actual compile process), emerge --fetchonly mysql is forced to wait

Expected Results:  
emerge gets fetchin'!
Comment 1 Zac Medico gentoo-dev 2008-07-02 22:14:57 UTC
The file lock is required once it makes the decision to download. However, we can make it skip the current file if that file happens to be locked by another process. This could be implemented by adding a new parameter to the portage.locks.lock() function which causes it to raise an exception if the file is already locked. This will give the caller an opportunity to decide not to acquire a lock on a file that is already locked. The --fetch code can simply handle the exception and move on to the next file.
Comment 2 Zac Medico gentoo-dev 2008-07-23 07:59:16 UTC
This is fixed in 2.2_rc2.