atom feed4 messages in net.sourceforge.lists.courier-imapRe: [Courier-imap] Patch for authdaem...
FromSent OnAttachments
Norbert KottmannMay 24, 2006 8:41 am 
Sam VarshavchikMay 24, 2006 3:21 pm 
Brian CandlerMay 25, 2006 12:40 am 
Brian CandlerMay 25, 2006 1:21 am 
Subject:Re: [Courier-imap] Patch for authdaemonlib.c opensock() function
From:Brian Candler (B.Ca@pobox.com)
Date:May 25, 2006 12:40:29 am
List:net.sourceforge.lists.courier-imap

On Wed, May 24, 2006 at 06:21:56PM -0400, Sam Varshavchik wrote:

We made a little testpatch for the opensock() function in authdaemonlib.c.

We patched the source because under high load, the imap and pop daemons (more than one ;-) can simutaniously block the socket to the authdaemond, so that another imap/pop daemon can not connect to the socket. This will lead to really ugly tempfails and the user has to retype the password.

Whats new:

If we can not connect to the UNIX socket, wait (random between 0.9s - 1.1s) and try again. Do this max 10 times and if the socket is still not available, exit with "authentication failed".

Wrong.

The correct solution is to increase the number of authdaemond processes, in the authdaemonrc configuration file.

But his patch seems only to make a difference in the case of EAGAIN. According to the connect(2) manpage:

EAGAIN No more free local ports or insufficient entries in the routing cache. For PF_INET see the net.ipv4.ip_local_port_range sysctl in ip(7) on how to increase the number of local ports.

But the unix(7) manpage doesn't list EAGAIN.

In any case, if all the authdaemond processes are busy (i.e. maxdaemons is too small), would you really get EAGAIN in that case? I would have thought something like ECONNREFUSED or ETIMEDOUT, but I've not tested it.

Regards,

Brian.