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 (changes requested): feat: add tcpKeepAliveCount, tcpKeepAliveIdle and tcpKeepAliveInterval connection properties
Date: Thu, 22 Oct 2026 08:14:14 +0000
Message-ID: <gh-pgjdbc-pgjdbc-3964-r5611144043@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-3964@github.com>
References: <gh-pgjdbc-pgjdbc-3964@github.com>

The project merges with rebase-and-merge, so all 40 commits would land on master as they are: 6 `Merge remote-tracking branch 'upstream/master' into issue-2487` commits, two `Fix styleCheck issues`, and about 20 subjects phrased as problem statements (`ExtendedSocketOptionAccessor is undocumented and bypassed through its…`). Please drop the merge commits and squash into Conventional Commits, for example:

1. `build: run source-distribution tests on Java 11+ against the META-INF/versions/11 classes` (the `reduced-pom.xml` change; it also fixes `LazyCleanerImpl`, which predates this PR).
2. `feat: add tcpKeepAliveCount, tcpKeepAliveIdle and tcpKeepAliveInterval connection properties` with a body that says why (with OS defaults the first probe goes out after about two hours idle), what the caller sees (the error and the warnings), and `Fixes #2487`.
3. `ci: add keep_alive axis to the test matrix` (or fold it into 2).

The PR title should follow the same format, and the PR body is stale: "If tests are needed, please give me some pointers" no longer describes the change.

Several claims are checked only in `ConnectionTest`, which needs a server, although the `PGStream` constructor only connects a socket, and a loopback `ServerSocket` (as in `ExtendedSocketOptionAccessorImplTest`) is enough:

- no server-free test covers `tcpKeepAlive=false` (or unset) with a probe option set;
- no server-free test covers `0`; `TcpKeepSettingsTest` uses only `-30`, and nothing checks that `1` is accepted;
- no server-free test covers `applyTo` being called from `createSocket`, or the copy constructor reapplying the settings;
- nothing covers the `BaseDataSource` setters: `setTcpKeepAliveIdle` writing the `tcpKeepAliveCount` key would pass every test. One parameterized set-then-get with a distinct value per property, plus a check that the "unset" value removes the key, would cover them.

With those in place, `aConnectionAppliesTheKeepAliveProbeSettingToTheSocket` is enough as the end-to-end test, and `aPGStreamCopyAppliesTheKeepAliveProbeSettingToItsSocket`, `aKeepAliveProbeSettingIsIgnoredWhenKeepAliveIsDisabled`, `keepAliveProbeOptionsThePlatformCannotApplyAreIgnored` and `nonPositiveKeepAliveProbeOptionIsRejected` can move to the server-free tests or go. As they stand:

- the first leaks the stream it opens at `ConnectionTest.java:580` (`new PGStream(pgStream, 10).getSocket()` is never closed);
- the third asserts only `con.isValid(5)`, so it shows neither a warning nor an ignored option;
- the last hardcodes the English message, which breaks under the locale axis once the msgid is translated; `TcpKeepSettingsTest` already uses `GT.tr` for it.

view thread (85+ messages)  latest in thread

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