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-rc4346009508@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/TcpKeepSettings.java:118)
`applySetting` catches only `SocketException`, so an `UnsupportedOperationException` from `setOption` still escapes and turns into SQLState `99999`, the outcome the earlier review called a blocker. `supportedOptions()` is not a reliable guard. On JDK 11 GA (`jdk-11+28`), `Socket.supportedOptions()` caches the set in a `private static` field shared by every socket in the JVM (fixed by JDK-8213418 in JDK 12). So a custom-`SocketImpl` socket can report the platform options because an ordinary socket asked first, and its `setOption` then throws. Please catch `UnsupportedOperationException` next to `SocketException` and log the "not supported" warning for it.