On Wed, Feb 27, 2019 at 10:07 PM Nagaura, Ryohei <nagaura.ryo...@jp.fujitsu.com> wrote: > I rewrote two TCP_USER_TIMEOUT patches. > I changed the third argument of setsockopt() from 18 to TCP_USER_TIMEOUT. > > This revision has the following two merits. > * Improve readability of source > * Even if the definition of TCP_USER_TIMEOUT is changed, it is not affected. > e.g., in the current linux, TCP_USER_TIMEOUT is defined, but even if it is > changed to 19, it 'll be available.
The documentation in TCP_backend_v8.patch needs some work. + the system default. This parameter is supported only on systems that support + TCP_USER_TIMEOUT or an equivalent socket option, and on Windows; on other + systems, it must be zero. In sessions connected via a Unix-domain socket, + this parameter is ignored and always reads as zero. So this says that it works on systems that have TCP_USER_TIMEOUT or an equivalent socket option and that it also works on Windows, and then a few lines later.... + This parameter is not supported on Windows, and must be zero. This says it actually doesn't work on Windows. I think the language about an equivalent socket option isn't helpful. We should document any equivalents we actually support, and not say anything about anything else. + To enable full control under TCP connection use this option together with + keepalive. That doesn't tell me anything useful. + Specify in milliseconds the time to disconnect to the client + when there is no ack packet from the client to the server's data transmission. + This parameter is supported on linux version 2.6.37 or later. Hmm. This looks like a second, and broadly better, definition of the parameter. Now we have a different definition of where it's supported. This is the THIRD attempt to tell me which platforms are supported -- just Linux, 2.6.37 or greater. + This parameter is not supported on Windows. And then, in case I missed the last three attempts to tell me about platform support, there's this. Have you checked whether this can be easily supported on FreeBSD and/or NetBSD? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company