Re: Timeout parameters

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "Nagaura, Ryohei" <nagaura(dot)ryohei(at)jp(dot)fujitsu(dot)com>
Cc: "Jamison, Kirk" <k(dot)jamison(at)jp(dot)fujitsu(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "AYahorau(at)ibagroup(dot)eu" <AYahorau(at)ibagroup(dot)eu>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "MikalaiKeida(at)ibagroup(dot)eu" <MikalaiKeida(at)ibagroup(dot)eu>
Subject: Re: Timeout parameters
Date: 2019-03-12 17:15:51
Message-ID: CA+TgmoaZSLiwqnHFVbLSZeGxvKEh8LknA0WHmPwBk67eoYzerg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 27, 2019 at 10:07 PM Nagaura, Ryohei
<nagaura(dot)ryohei(at)jp(dot)fujitsu(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-03-12 17:17:19 Re: Use nanosleep(2) in pg_usleep, if available?
Previous Message Tomas Vondra 2019-03-12 17:14:53 Re: WIP: BRIN multi-range indexes