From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: lizenko79@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol
Date: Tue, 27 Jun 2017 16:16:53 -0400
Message-ID: <20527.1498594613@sss.pgh.pa.us> (raw)
In-Reply-To: <20170627191732.bqh677xgt5bbdo7t@alvherre.pgsql>
References: <20170627191732.bqh677xgt5bbdo7t@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> lizenko79@gmail.com wrote:
>> I've got the following message running PostgreSQL 9.6.3 on Solaris 11.3
>> (both latest stable).
>> getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol
> It sounds like your system defines the TCP_KEEPALIVE symbol at compile
> time but the kernel doesn't know it; maybe the package was compiled in a
> system where the kernel does support that option, and you're running it
> in one that doesn't?
Actually, I find the same error in the logs for our Solaris buildfarm
members. So apparently that's been going on since day one, and we
hadn't noticed it, though I now find that it's been reported before:
https://www.postgresql.org/message-id/CAJgtxT6QL0_Gt+TkSDw=q1=YVJkT73FoSrtStcu5Hy+-SXn8rw@mail.gmail...
Some googling turned up the tcp(7P) man page for Solaris 11:
https://docs.oracle.com/cd/E36784_01/html/E36884/tcp-7p.html#REFMAN7tcp-7p
and it says this:
SunOS supports the keep-alive mechanism described in RFC 1122. It is
enabled using the socket option SO_KEEPALIVE. When enabled, the first
keep-alive probe is sent out after a TCP is idle for two hours. If the
peer does not respond to the probe within eight minutes, the TCP
connection is aborted. You can alter the interval for sending out the
first probe using the socket option TCP_KEEPALIVE_THRESHOLD. The option
value is an unsigned integer in milliseconds. The system default is
controlled by the TCP ndd parameter tcp_keepalive_interval. The minimum
value is ten seconds. The maximum is ten days, while the default is two
hours. If you receive no response to the probe, you can use the
TCP_KEEPALIVE_ABORT_THRESHOLD socket option to change the time threshold
for aborting a TCP connection. The option value is an unsigned integer
in milliseconds. The value zero indicates that TCP should never time out
and abort the connection when probing. The system default is controlled
by the TCP ndd parameter tcp_keepalive_abort_interval. The default is
eight minutes.
So apparently, Linux's TCP_KEEPIDLE corresponds to Solaris'
TCP_KEEPALIVE_THRESHOLD. TCP_KEEPINTVL and TCP_KEEPCNT seem to have no
direct equivalent, although TCP_KEEPALIVE_ABORT_THRESHOLD would correspond
to their product.
I suggest that we ought to expand the keepalive code to know about this
synonym.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, lizenko79@gmail.com
Subject: Re: BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol
In-Reply-To: <20527.1498594613@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox