pg.ddx.io  GitHub: pgjdbc/pgjdbc (issues + PRs as email threads)  
help / color / mirror / Atom feed
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: Wed, 09 Sep 2026 20:20:22 +0000
Message-ID: <gh-pgjdbc-pgjdbc-3964-rc3972654715@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/PGStream.java)

**Blocker.** These three reads are unconditional, and the surrounding `catch` on line 164 only catches `SocketException`. `UnsupportedOperationException` is not one, so on Windows/JDK 11-21 or behind a `socketFactory` with a custom `SocketImpl` it escapes this constructor — for users who set none of the new properties.

This constructor is the SSL fallback (`enableSSL`, server answers `'E'` to `SSLRequest`, `ConnectionFactoryImpl:712`) and the `gssEncMode=prefer` fallback (`:651`), so the regression reaches people who have never heard of `tcpKeepAliveIdle`.

Also note `getOption` returns the *system default* rather than null when the user configured nothing (measured: 8 / 7200 / 75 on macOS, JDK 21), so the setters below always fire and pin the OS defaults onto the replacement socket. Please read these only when something was actually configured, and gate on `supportedOptions()`.

(I checked the leak question — `tryConnect`'s `catch (Exception e) { closeStream(newStream, e); throw e; }` does close the old stream, because `newStream` is not reassigned when `enableSSL` throws. No leak.)

view thread (85+ messages)  latest in thread

Message-ID: <gh-pgjdbc-pgjdbc-3964-rc3972654715@github.com>
Permalink:  ../gh-pgjdbc-pgjdbc-3964-rc3972654715@github.com/

 · 


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