A NOTE has been added to this issue. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=957 
====================================================================== 
Reported By:                gcth
Assigned To:                paul
====================================================================== 
Project:                    DBMail
Issue ID:                   957
Category:                   IMAP daemon
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     confirmed
target:                      
====================================================================== 
Date Submitted:             27-Jan-12 11:07 CET
Last Modified:              10-Jan-13 08:46 CET
====================================================================== 
Summary:                    imapd leaks sockets
Description: 
I'm currently using latest git dbmail with imap only, and I've noticed that
it refuses connections after few hours of working. lsof shows lots of open
sockets:

dbmail-im 24466     dbmail 1352u     sock                0,6          0t0 
  1917799 can't identify protocol
dbmail-im 24466     dbmail 1353u     sock                0,6          0t0 
  1917800 can't identify protocol
dbmail-im 24466     dbmail 1354u     sock                0,6          0t0 
  1917801 can't identify protocol
dbmail-im 24466     dbmail 1355u     sock                0,6          0t0 
  1917802 can't identify protocol
dbmail-im 24466     dbmail 1356u     sock                0,6          0t0 
  1917803 can't identify protocol
dbmail-im 24466     dbmail 1357u     sock                0,6          0t0 
  1917804 can't identify protocol
dbmail-im 24466     dbmail 1358u     sock                0,6          0t0 
  1917805 can't identify protocol

they are increasing in time leading to saturation of nofiles ulimit. This
problem applies to imapd, I could not reproduce this problem with pop3.
Typical clients connects with latest thundderbird, mostly from local LAN.
Increasing ulimit -n to 8192 allows enough leaks to last for whole day, so
now as a workaround I restart dbmail every night. I'm attaching munin graph
for:
lsof -ln -u dbmail | grep ^dbmail-im   | fgrep sock\  -c
during normal work hours.
====================================================================== 

---------------------------------------------------------------------- 
 (0003392) paul (administrator) - 27-Jan-12 16:35
 http://www.dbmail.org/mantis/view.php?id=957#c3392 
---------------------------------------------------------------------- 
I can confirm this. Looks like there is a thread-race in the imap code.

 

---------------------------------------------------------------------- 
 (0003429) gcth (reporter) - 03-Apr-12 17:07
 http://www.dbmail.org/mantis/view.php?id=957#c3429 
---------------------------------------------------------------------- 
In current master this bug is still present.
Any chances for a fix? What else do you need to debug this? 

---------------------------------------------------------------------- 
 (0003449) vampyre (reporter) - 15-May-12 19:46
 http://www.dbmail.org/mantis/view.php?id=957#c3449 
---------------------------------------------------------------------- 
Hello Paul,

Could you please share your assumptions if you have some, as this is quite
major issue and it is important to get it fixed as fast as possible.

Thank you. 

---------------------------------------------------------------------- 
 (0003456) JensKapitza (reporter) - 06-Jun-12 17:32
 http://www.dbmail.org/mantis/view.php?id=957#c3456 
---------------------------------------------------------------------- 
Can be produced with going offline in thunderbird

seems to be a problem in gooing offine
(closing thunderbird) works 

---------------------------------------------------------------------- 
 (0003505) nickdb161 (reporter) - 02-Nov-12 14:48
 http://www.dbmail.org/mantis/view.php?id=957#c3505 
---------------------------------------------------------------------- 
I am using Postfix/Dovecot proxy/DBMail and get this problem of running out
of file descriptors (although the sockets seem to close correctly - none
remaining in netstat?). I have enclosed extracts of the debugging output
which indicates where the problem might be occurring:

dbmail/imap4d[18505]: [0x822fc0] Notice:[imap] _ic_logout(+179):
[0x883220] userid:[0]
dbmail/imap4d[18505]: [0x822fc0] Debug:[imap] imap_handle_input(+396):
imap4 returned [2]
dbmail/imap4d[18505]: [0x822fc0] Debug:[imap] imap_handle_exit(+262):
[0x883220] state [4] command_status [0] [LOGOUT] returned with status [2]
dbmail/imap4d[18505]: [0x822fc0] Info:[clientbase] ci_write(+312):
[0x9a9020] S > [7/7:* BYE#015#012]
dbmail/imap4d[18505]: [0x822fc0] Debug:[clientbase] client_error_cb(+134):
[0x9a9020] 18 Broken pipe[32], 0x9a9020
dbmail/imap4d[18505]: [0x822fc0] Debug:[imap] imap_session_printf(+201):
ci_write failed [Unknown error 18446744073709551615]
dbmail/imap4d[18505]: [0x822fc0] Debug:[imap]
dbmail_imap_session_set_state(+1562): state [6]
dbmail/imap4d[18505]: [0x822fc0] Debug:[imap]
dbmail_imap_session_set_state(+1591): [0x883220] state [4]->[6]

I am having to restart dbmail-imapd at least once per day to avoid this. I
do not want to increase the file descriptors.

Hope this is of some use. 

---------------------------------------------------------------------- 
 (0003508) vampyre (reporter) - 07-Dec-12 09:58
 http://www.dbmail.org/mantis/view.php?id=957#c3508 
---------------------------------------------------------------------- 
Hello Paul,

It looks like a lot of work has been done to improve the situation, could
you please announce expected delivery date of some release candidate.

Thank you. 

---------------------------------------------------------------------- 
 (0003512) vampyre (reporter) - 10-Jan-13 08:46
 http://www.dbmail.org/mantis/view.php?id=957#c3512 
---------------------------------------------------------------------- 
Hello Paul, 

Is there any new information regarding "delivery date"?

Looking forward to to hearing from you. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
27-Jan-12 11:07  gcth           New Issue                                    
27-Jan-12 11:07  gcth           File Added: sockets.png                      
27-Jan-12 16:35  paul           Note Added: 0003392                          
27-Jan-12 16:35  paul           Assigned To               => paul            
27-Jan-12 16:35  paul           Status                   new => confirmed    
03-Apr-12 17:07  gcth           Note Added: 0003429                          
15-May-12 19:46  vampyre        Note Added: 0003449                          
06-Jun-12 17:32  JensKapitza    Note Added: 0003456                          
02-Nov-12 14:48  nickdb161      Note Added: 0003505                          
07-Dec-12 09:58  vampyre        Note Added: 0003508                          
10-Jan-13 08:46  vampyre        Note Added: 0003512                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to