Bug 301207

Summary: amarok fails to sync itunesdb with "too many open files" error
Product: [Applications] amarok Reporter: Piotr Keplicz <keplicz>
Component: Collections/iPod iPhoneAssignee: Amarok Developers <amarok-bugs-dist>
Severity: normal CC: matej
Priority: NOR    
Version: 2.5-git   
Target Milestone: 2.6   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 2.6

Description Piotr Keplicz 2012-06-05 11:10:54 UTC
When copying a collection of 6700 tracks, Amarok fails to update the iTunesDB during the process with a "Too many open files" error. Indeed, during the transfer, lsof show a continously raising number of open files with cover artwork (/tmp/kde-$USER/amarok*.png). 

ulimit is: open files (-n) 1024

Reproducible: Always

Steps to Reproduce:
1. Attempt to transfer a large collection to an iPod.

Actual Results:  
A message appears in the lower right corner of the main Amarok window, stating that creating an iTunesDB.xxx file resulted in a "Too many open files error".

At the end, transfer fails with an "internal Amarok error" notice.

Expected Results:  
Tracks are copied regardless of their count.
Comment 1 Matěj Laitl 2012-06-05 11:17:53 UTC
Thanks for the report, I can confirm this bug. This is connected to the way we store album covers that are determined to be written to the Amarok db. I'll investigate how we can work around the open files limit.
Comment 2 Matěj Laitl 2012-06-05 21:43:47 UTC
Git commit 980fdcac9892d19737b9cd51a3fb270d27c4bd09 by Matěj Laitl.
Committed on 05/06/2012 at 23:38.
Pushed by laitl into branch 'master'.

IpodCollection: Don't hit ulimit -n when copying covers

This was because QTemporaryFile holds its file open. It cannot be
forced to close its file, so use slightly more dumb solution.

M  +1    -0    ChangeLog
M  +1    -0    src/core-impl/collections/ipodcollection/IpodCollection.cpp
M  +12   -12   src/core-impl/collections/ipodcollection/IpodMeta.cpp
M  +4    -5    src/core-impl/collections/ipodcollection/IpodMeta.h