[Dovecot] [PATCH] net_connect_*(): Wait for fd to complete connect(2) when fd is non-blocking

Timo Sirainen tss at iki.fi
Wed Aug 10 20:37:46 EEST 2011


On 2.8.2011, at 5.25, SATOH Fumiyasu wrote:

>>> Dovecot ignores EINPROGRESS on connect(2) for non-blocking fd.
>>> This is wrong. After that, read(2) to fd (or write(2) to fd) fails
>>> with ENOTCONN if the connection of fd is not completed.
>>> 
>>> The attached patch fixes this problem.

If you do that, then there's no point in making the socket non-blocking before connect().

> On a high-load Solaris 10 box, dovecot-lda fails to query (I/O) to
> dovecot dict socket with ENOTCONN. My patch fixes this problem.

I think Linux/etc returns EAGAIN in such situation. Maybe the right fix is to just add EINPROGRESS check for net_connect_unix_with_retries()? (With some extra changes so that it actually sees that errno from net_connect_unix())




More information about the dovecot mailing list