From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #3964: feat: add tcpKeepAliveCount, tcpKeepAliveIdle and tcpKeepAliveInterval connection properties
Date: Thu, 22 Oct 2026 08:14:14 +0000
Message-ID: <gh-pgjdbc-pgjdbc-3964-rc4346009556@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-3964@github.com>
References: <gh-pgjdbc-pgjdbc-3964@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/ExtendedSocketOptionAccessorImpl.java)
"the keep-alive probe options of `jdk.net.ExtendedSocketOptions` only exist from Java 11" is false: JDK 8u272 added `TCP_KEEPIDLE`, `TCP_KEEPINTERVAL` and `TCP_KEEPCOUNT` to JDK 8's `jdk.net.ExtendedSocketOptions` (JDK-8194298 backport). There they are set through `jdk.net.Sockets.setOption(Socket, ...)`, because Java 8's `Socket` has no `setOption` or `supportedOptions()`. This variant finds nothing because it does not use `jdk.net.Sockets`; please say that, and that Java 8 support is left out by choice. The same applies to the `@return` in `ExtendedSocketOptionAccessor` ("`null` if `socket` does not accept it"), which is not why it returns `null` on Java 8.