Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol
Date
Msg-id 20527.1498594613@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option notsupported by protocol  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-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.com

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.
Whenenabled, the first keep-alive probe is sent out after a TCP is idle for two hours. If the peer does not respond to
theprobe within eight minutes, the TCP connection is aborted. You can alter the interval for sending out the first
probeusing the socket option TCP_KEEPALIVE_THRESHOLD. The option value is an unsigned integer in milliseconds. The
systemdefault is controlled by the TCP ndd parameter tcp_keepalive_interval. The minimum value is ten seconds. The
maximumis ten days, while the default is two hours. If you receive no response to the probe, you can use the
TCP_KEEPALIVE_ABORT_THRESHOLDsocket option to change the time threshold for aborting a TCP connection. The option value
isan unsigned integer in milliseconds. The value zero indicates that TCP should never time out and abort the connection
whenprobing. The system default is controlled by the TCP ndd parameter tcp_keepalive_abort_interval. The default is
eightminutes. 

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

pgsql-bugs by date:

Previous
From: Martin Garton
Date:
Subject: Re: [BUGS] BUG #14719: Logical replication unexpected behaviour whentarget table has missing columns
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14720: getsockopt(TCP_KEEPALIVE) failed: Option not supported by protocol