Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-27 Thread Andres Freund
On 2013-06-26 20:07:40 -0400, Tom Lane wrote: I don't see how we could trigger the conditions for EINPROGRESS on windows that msdn lists, but since we need it on unixoid systems and its valid to treat the connect as partiall successfull on windows, there seems little benefit in dropping

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-27 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-06-26 20:07:40 -0400, Tom Lane wrote: However, some more trolling of the intertubes suggests that Cygwin's emulation of socket() does indeed return EINPROGRESS; see for instance this ancient thread of ours:

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-27 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-06-26 20:07:40 -0400, Tom Lane wrote: I still want to delete the test for SOCK_ERRNO == 0. I traced that back to commit da9501bddb4dc33c031b1db6ce2133bcee7b, but I can't find anything in the mailing list archives to explain that. I

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-26 Thread Andres Freund
Hi, On 2013-06-17 16:16:22 +0200, Andres Freund wrote: When postgres on linux receives connection on a high rate client connections sometimes error out with: could not send data to server: Transport endpoint is not connected could not send startup packet: Transport endpoint is not connected

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-06-17 16:16:22 +0200, Andres Freund wrote: Not accepting EWOULDBLOCK in the above if() results in: could not connect to server: Resource temporarily unavailable Is the server running locally and accepting connections on Unix domain socket

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-26 Thread Andres Freund
On 2013-06-26 12:07:54 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2013-06-17 16:16:22 +0200, Andres Freund wrote: Not accepting EWOULDBLOCK in the above if() results in: could not connect to server: Resource temporarily unavailable Is the server running locally

Re: [HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-26 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2013-06-26 12:07:54 -0400, Tom Lane wrote: ... I wonder whether it's safe to remove the case altogether. Could anyone research the situation for non-blocking connect() on Windows? Perhaps on Windows we shouldn't test for EINPROGRESS at all?

[HACKERS] PQConnectPoll, connect(2), EWOULDBLOCK and somaxconn

2013-06-17 Thread Andres Freund
Hi, When postgres on linux receives connection on a high rate client connections sometimes error out with: could not send data to server: Transport endpoint is not connected could not send startup packet: Transport endpoint is not connected To reproduce start something like on a server with