# cat /proc/version Linux version 2.4.20-18.9 (bhcompile at daffy.perf.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu May 29 07:09:43 EDT 2003 # dovecot --version 0.99.10 I've just recently noticed a serious problem with my system. After about an hour or so I get errors in /var/log/maillog such as this; Sep 21 06:40:16 the-system imap(ray): opendir() failed with file \ \/home/ray/Maildir//new: Too many open files I investigated with 'lsof' and found that many copies of '.customflags' were open for each and every folder. ie; Each folder's '.customflags' file was open 15 times! I suspect that postfix is not able to store newly collected email while this is occuring, therefore I am likely losing messages. I've tried with multiple mail clients (Sylpheed & Evolution) and multiple users, always with the same result. Further investigation indicates that each time the client scans for new mail another instance of each and every '.customflags' is opened. As I have the client set for checking at five minute intervals then it was probably 75 minutes until the client barfed. Less, if I manualy scan for new mail a few times. If I shutdown the client and restart it then everything is fine for about an hour. Running 'lsof /home/ray/Maildir/.customflags' on the server I can see the list of files increasing each time the client checks for new mail. Any help would be appreciated!
Timo Sirainen
2003-Sep-22 14:28 UTC
[Dovecot] Multiple instances of .customflags staying open
On Mon, 2003-09-22 at 16:13, Ron wrote:> I've just recently noticed a serious problem with my system. After about > an hour or so I get errors in /var/log/maillog such as this; > Sep 21 06:40:16 the-system imap(ray): opendir() failed with file \ > \/home/ray/Maildir//new: Too many open files > > I investigated with 'lsof' and found that many copies of '.customflags' > were open for each and every folder. ie; Each folder's '.customflags' > file was open 15 times!Could it be that your .customflags files are not writable to users? That's the only code path that I can see it leaking file descriptors for .customflags. Attached patch should also fix it. -------------- next part -------------- A non-text attachment was scrubbed... Name: leak.diff Type: text/x-patch Size: 1060 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20030922/73030e7a/attachment-0001.bin>
On Mon, 22 Sep 2003 17:28:48 +0300 Timo Sirainen (Timo Sirainen <tss at iki.fi>) said:> On Mon, 2003-09-22 at 16:13, Ron wrote: > > I've just recently noticed a serious problem with my system. After > > about an hour or so I get errors in /var/log/maillog such as this; > > Sep 21 06:40:16 the-system imap(ray): opendir() failed with file \ > > \/home/ray/Maildir//new: Too many open files > > > > I investigated with 'lsof' and found that many copies of > > '.customflags' were open for each and every folder. ie; Each > > folder's '.customflags' file was open 15 times! > > Could it be that your .customflags files are not writable to users?No, they're all writable to the user.> That's the only code path that I can see it leaking file descriptors > for.customflags. Attached patch should also fix it.This is likely a dumb question, but how do I apply the patch? I'm no programmer, just an admin/user. btw, the situation got worse today. I couldn't keep the mail client running for more than a minute at a time. This is a real nuicence. Thanks for the speedy reply!