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-rc3972654709@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-3964@github.com>
References: <gh-pgjdbc-pgjdbc-3964@github.com>

(on pgjdbc/src/main/java11/org/postgresql/core/ExtendedSocketOptionAccessorImpl.java)

Two things here.

`ClassUtils.forName` is documented as loading "a class named by a connection property", and its fourth parameter as "the driver's own classloader". Neither describes this use, and `expectedClass = Object.class` defeats the `asSubclass` check the utility exists for. A plain `Class.forName(EXTENDED_SOCKET_OPTIONS_CLASS_NAME, false, ClassLoader.getPlatformClassLoader())` says what is actually happening.

The catch list misses throwables that reach the connect path as unchecked: `SecurityException` from `Class.forName`/`getField`, `NoClassDefFoundError`/`LinkageError`, and `ExceptionInInitializerError` — `ClassUtils.forName` loads with `initialize=false`, so `ExtendedSocketOptions`' static initialiser runs on the `Field.get(null)` below, and that initialiser loads the `extnet` native library.

Minor: `e.getMessage()` may be null, which silently selects the less informative message branch in `SocketOptionReference`.

view thread (85+ messages)  latest in thread

Message-ID: <gh-pgjdbc-pgjdbc-3964-rc3972654709@github.com>
Permalink:  ../gh-pgjdbc-pgjdbc-3964-rc3972654709@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