Re: keepalives on MacOS X - Mailing list pgsql-hackers

From Tom Lane
Subject Re: keepalives on MacOS X
Date
Msg-id 10707.1277786542@sss.pgh.pa.us
Whole thread Raw
In response to keepalives on MacOS X  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: keepalives on MacOS X  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> It looks like the recent keepalives patch won't support MacOS X,
> because MacOS X does not have the TCP_KEEPIDLE, TCP_KEEPINTVL, and
> TCP_KEEPCNT socket parameters.  It does have this:

It looks to me like there's support for setting KEEPIDLE and KEEPINTVL
via sysctl, but of course that's system-wide and presumably requires
root privilege to set.  (Apple seems to have inherited that from various
BSDen, btw; it's not unique to Darwin.)

> #define TCP_KEEPALIVE           0x10    /* idle time used when
> SO_KEEPALIVE is enabled */

> Should we try to support that as a synonym for TCP_KEEPIDLE, if that's
> what it is?  Or not worry about it?  Or... what?

Yeah, a bit of rooting around in the Darwin sources shows that this
value is used as a per-connection override for tcp_keepidle.  So it
is a synonym.  Not sure if it's worth supporting when the other value
can't be set too.  Maybe it'd be more useful to document that people can
set the system-wide values if they're desperate.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: keepalives on MacOS X
Next
From: Fujii Masao
Date:
Subject: Re: suppress automatic recovery after back crash