pgpool2.git / summary / log / commit / refs

commit    eb310fca19fbf700e9d83029f18673bc1a308f9a
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Wed Dec 05 00:15:35 2012 +0000

    Fix connect_inet_domain_socket_by_port() to not error out when
    connect(2) returns EISCONN(Socket is already connected) erro. This
    could happen with non blocking socket and should be treated as normal.
    Per bug track #29 and pgpool-general 1218.


pool_connection_pool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pool_connection_pool.c b/pool_connection_pool.c index 05cf496f0..5b9f909d6 100644 --- a/pool_connection_pool.c +++ b/pool_connection_pool.c @@ -566,6 +566,12 @@ int connect_inet_domain_socket_by_port(char *host, int port, bool retry) if (connect(fd, (struct sockaddr *)&addr, len) < 0) { + if (errno == EISCONN) + { + /* Socket is already connected */ + break; + } + if ((errno == EINTR && retry) || errno == EAGAIN) continue; [parent: 6573fbfdf745]