Jelte Fennema <jelte.fenn...@microsoft.com> writes: > Thanks for all the cleanup and adding of windows support. To me it now looks > good to merge.
I was about to commit this when I started to wonder if it actually does anything useful. In particular, I read in the Linux tcp(7) man page TCP_USER_TIMEOUT (since Linux 2.6.37) ... This option can be set during any state of a TCP connection, but is effective only during the synchronized states of a connection (ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, and LAST-ACK). ISTM that the case we care about is where the server fails to respond to the TCP connection request. If it does so, it seems pretty unlikely that it wouldn't then eat the small amount of data we're going to send. While the keepalive options aren't so explicitly documented, I'd bet that they too don't have any effect until the connection is known established. So I'm unconvinced that setting these values really has much effect to make PQcancel more robust (or more accurately, make it fail faster). I would like to know what scenarios you tested to convince you that this is worth doing. regards, tom lane