pg.ddx.io GitHub: pgjdbc/pgjdbc (issues + PRs as email threads)
help / color / mirror / Atom feed[pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
58+ messages / 3 participants
[nested] [flat]
* [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-08-01 09:16 "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
0 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-08-01 09:16 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document?
* [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?
### Changes to Existing Features:
* [x] Does this break existing behaviour? If so please explain.
* Behaviour change only when FINEST protocol dumps would exceed **16384** characters (new default). Truncated messages end with `...(truncated)`. Set `maxLogMessageLength=0` for the previous unlimited dumps.
* [x] Have you added an explanation of what your changes do and why you'd like us to include them?
* [x] Have you written new tests for your core changes, as applicable?
* [x] Have you successfully run tests with your changes locally?
## Summary
Fixes #995; FINEST Bind dumps with many/large parameters could allocate unbounded strings and OOM while logging.
### Changes
- New connection property **`maxLogMessageLength`** (default `16384`, `0` = unlimited)
- Cap `FE=> Bind(...)` dumps via `BindLog` (stop appending params once the budget is exhausted; skip materializing individual values larger than the remaining budget)
- Limit `FE=> Parse(...)` and `FE=> SimpleQuery(...)` traces the same way; a negative value is rejected
- DataSource getter/setter + docs
### Tests
```
./gradlew :postgresql:test \
--tests 'org.postgresql.util.internal.LogMessageUtilsTest' \
--tests 'org.postgresql.core.v3.BindLogTest' \
--tests 'org.postgresql.test.jdbc2.PGPropertyTest' \
--tests 'org.postgresql.test.jdbc2.MaxLogMessageLengthTest'
```
Also ran `:postgresql:checkstyleMain` / `checkstyleTest`.
### AI/LLM disclosure
- AI coding tools (Codex and Claude Code) were used to help draft or modify code and this PR description.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-08-01 09:34 ` "davecramer (@davecramer)" <noreply+davecramer@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: davecramer (@davecramer) @ 2026-08-01 09:34 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
## Review
Overall this is a clean, well-scoped, well-tested change. Conventions are followed (property definition, `getIntNoCheck` DataSource accessor matching the other int properties, copyright headers, FINEST guards), and the tests cover the small/capped/unlimited/huge-single-value cases plus the tiny-`maxLength` boundary of the suffix. I found no correctness bug that breaks well-formed logging. A few notes, the first worth addressing.
### 🟡 Medium — the "don't materialize huge values" guard misses value types `estimateLogSize` doesn't recognize
`estimateLogSize` only recognizes `byte[]`, `String`, `StreamWrapper`, and `ByteStreamWriter`; for anything else it returns `-1`. In `BindLog.format`, the placeholder short-circuit only fires when `estimated > remaining`:
```java
int estimated = params.estimateLogSize(i);
if (estimated > remaining) { // -1 > remaining is always false
... placeholder ...
continue;
}
String value = params.toString(i, standardConformingStrings); // full materialization
```
So for a value whose type isn't one of the four (e.g. a large array or `PGobject` bound via `setObject`), `estimated == -1`, the guard is skipped, and `toString(i, …)` **fully renders the value** before `appendBounded` trims it — which is exactly the materialization #995 is about. It's bounded per-message by `maxLogMessageLength` only *after* the full render, so it is no longer an unbounded OOM, but the protection is narrower than the PR implies.
Most large params in practice are `String` or `byte[]` (both covered), so this is a partial gap rather than a regression. Worth either (a) treating `estimated < 0` (unknown) as "render at most `remaining`, never more" — i.e. cap the intermediate render — or (b) documenting that the guard is best-effort for recognized types.
### Minor
- **Placeholder unit is mislabeled.** The oversized-value placeholder is `"...(" + estimated + " bytes)"`, but for a `String` parameter `estimateLogSize` returns `String.length()` (characters), and for bytea the rendered form is hex (~2× the raw bytes). "chars" or "~N bytes" would be more accurate than "bytes".
- **Dangling parameter fragment on budget exhaustion.** The loop appends `,$i=<` *before* recomputing `remaining` and breaking, so a capped line can end mid-parameter like `…,$37=<...(truncated)`. Cosmetic and arguably fine for a truncated debug dump, but computing `remaining` before appending the `,$i=<` prefix would produce cleaner output.
- **`estimateLogSize` `-1` semantics are overloaded.** The Javadoc says `-1` means "unknown / null", but callers can't distinguish the two and treat it as "small enough to render." Functionally fine; the comment just slightly oversells what `-1` conveys.
### Correctness spot-checks (all pass)
- Default `16384` preserves prior behaviour except for dumps that would exceed 16 KB — matches the description.
- `maxLogMessageLength` is clamped with `Math.max(0, …)` in the constructor, so a negative value cleanly means "unlimited".
- Both formatters sit inside `LOGGER.isLoggable(Level.FINEST)` guards, so there is zero cost when FINEST is off.
- Final `truncate(sbuf, maxLen)` guarantees the returned line never exceeds the cap even when intermediate appends (`">,type=…"`, `"})"`) overshoot.
### Recommendation
Good, focused fix with solid tests. Approve after either tightening the unknown-type materialization path (the Medium item) or documenting the guard as best-effort for recognized types; the rest are minor polish.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-08-01 11:54 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-08-01 11:54 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Thanks for the thorough review @davecramer — addressed in 5ce8aaf:
**Medium (unknown-type materialization)**
- `estimateLogSize` now returns fixed sizes for unset (`"?"` → 1) and SQL-null (`"(NULL)"` → 6); `-1` is only for truly unknown value types.
- When the estimate is `< 0` or exceeds the remaining budget, `BindLog` uses a placeholder (`...(unestimated)` / `...(~N chars)`) and never calls `toString` on the value.
- Covered by a unit test that injects an unrecognized huge object via reflection.
**Minors**
- Placeholder unit: `bytes` → `~N chars`.
- Dangling `,$i=<`: budget is checked **before** appending the parameter prefix.
- `-1` Javadoc clarified (unknown size only; nulls are sized).
Focused tests: `BindLogTest`, `LogMessageUtilsTest`, `PGPropertyTest` — all green.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-08-16 04:42 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-08-16 04:42 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
addressed all three: unrecognized types (estimateLogSize < 0) now use a placeholder instead of materializing via toString, oversized placeholder says chars not bytes, and the ,$i=< prefix only gets appended once it's confirmed to fit so no more dangling fragments.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-12 17:07 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-12 17:07 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Hi, gentle ping on this when someone has a moment. Happy to adjust anything. Thanks!
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java:79)
When the room left is no larger than `,$i=<` (here), or is used up exactly (line 44), the loop stops and the message gets no `...(truncated)` marker, so a reader cannot tell that parameters are missing. If one character of room is left, line 83 closes the message with `)`, and it looks complete: in `manyBindsAreCapped` the trace is 512 characters ending `,$5=<...(~88 chars)>,type=VARCHAR)`, and `$6` to `$500` are gone. With `maxLogMessageLength=59` and 30 `int4` parameters the trace is ` FE=> Bind(stmt=null,portal=null,$1=<('1'::int4)>,type=INT4`. Please mark the message as truncated whenever a parameter is left out.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
"a single driver log message" covers more than the property limits: the traces of server messages (`ErrorMessage`, `NoticeResponse`, `AsyncNotify`, `ParameterStatus`) and the `Constructing object from type=...` trace in `PgConnection.getObject` stay unbounded. Please name the traces the property bounds, here, in `logging.md`, and in the `PGProperty` Javadoc and description.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
This passes for a trace that lost parameters without a marker. With `maxLen = 512` the trace is 512 characters ending `,$5=<...(~88 chars)>,type=VARCHAR)`: `log.length() < maxLen` is false, but `log.contains("...")` matches the `...(~88 chars)` placeholder. Please assert `log.endsWith(LogMessageUtils.TRUNCATION_SUFFIX)`, and remove the comment above, which allows a trace to stop between parameters with no suffix.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/util/LogMessageUtils.java:17)
A public class in `org.postgresql.util` reads as driver API, and applications come to depend on it. Please move this class to `org.postgresql.util.internal`, next to `FileUtils` and `PgBufferedOutputStream`.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332 (changes requested): fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
With `preferQueryMode=simple`, the driver inlines parameters into the SQL text, and `sendSimpleQuery` logs that text whole (`QueryExecutorImpl.java:2300`). A 200 MB `bytea` there still produces a trace of 400 million characters. Please bound this trace too: `LogMessageUtils.truncate(nativeSql, maxLogMessageLength)` inside an `isLoggable(Level.FINEST)` check covers it.
No test runs a statement through `QueryExecutorImpl`, so nothing checks that `maxLogMessageLength` reaches the traces. Please add a test that attaches a handler to the `org.postgresql` logger, runs statements on a live connection in extended and in simple query mode, and asserts the length of every record. Measure each record through `Formatter.formatMessage`: a record logged with parameters, such as the `SimpleQuery` one, carries only the format string in `getMessage()`.
A negative `maxLogMessageLength` is treated as `0`, that is, no limit (`QueryExecutorImpl.java:270`), and the documentation does not say so. Please document it or reject the value.
`BindLogTest` imports `assertEquals` without using it, so `autostyleJavaCheck` fails.
The new default changes what a FINEST trace contains, so the change needs a `CHANGELOG.md` entry.
The branch has a merge commit from master. Please rebase onto master instead of merging it into the branch.
The traces of server messages (`ErrorMessage`, `NoticeResponse`, `AsyncNotify`, `ParameterStatus`), the type-conversion trace in `PgConnection.getObject`, and a separate limit for one parameter, like `log_parameter_max_length` on the server, can wait. I will add them in a follow-up after this PR is merged, starting from the code in #4342.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
A text value longer than the room left is logged as `...(~20000 chars)`, with none of its content, so the trace no longer shows what the statement ran on. For JSON or XML, a prefix is what makes the trace useful. For a `String` value, escape only its first `remaining` characters, cut the result to the room left without splitting a surrogate pair or a doubled quote, and end it with `...`. Escaping at most doubles the prefix, so the full literal is never built, and a cut value does not look complete.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 02:52 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
For a `bytea`, `estimateLogSize` returns the number of bytes, but `toString` renders a hex literal of `2 * n + 11` characters. With the default limit, a `bytea` of about 8 to 16 KB passes this check, its literal fills the message, and every parameter after it is dropped: `setBytes(1, new byte[10000])` followed by `setInt(2, 42)` logs no `$2`. A `String` passes the same way when quoting, escaping, and the `::type` cast make its literal longer than the room left; a value of 16000 `'` characters doubles when escaped. The placeholder also labels the byte count of a `bytea` as `~N chars`.
Please compare the length of the literal (`2 * n + 11` for a `bytea`) with the room left, show an oversized `bytea` as `<N bytes>`, and add a test with a `bytea` followed by another parameter.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
sized bytea by hex literal length (2*n+11); oversized shows <n bytes>; added test with bytea then int
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
string values now keep an escaped readable prefix ending with ... instead of a size-only placeholder
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java:79)
omitted parameters always append ...(truncated) so the trace cannot look complete
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
manybindsarecapped now asserts endswith(truncation_suffix)
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/util/LogMessageUtils.java:17)
moved logmessageutils to org.postgresql.util.internal
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
docs and pgproperty now name bind/parse dumps only; call out unbounded errormessage/noticeresponse/asyncnotify/parameterstatus and getobject traces
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 04:56 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
addressed review: bytea literal sizing, string prefixes, truncation marker, moved LogMessageUtils to util.internal, docs narrowed to bind/parse, tests green, ptal
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
These assertions pass when the trace drops `,type=…`, shows the first parameter's value for every `$i`, or, in `unlimitedKeepsFullDump`, shows no values at all. On failure they print `expected: <true> but was: <false>` without the trace. The whole line is known here, and under the limit it must match the format logged before this PR, so please compare it with a literal: `assertEquals(" FE=> Bind(stmt=S_1,portal=null,$1=<('1'::int4)>,type=INT4,$2=<('2'::int4)>,type=INT4)", log)`. The same applies to `unlimitedKeepsFullDump` at line 185 and to the newer tests: line 87 passes on the `...` of `...(truncated)`, and lines 166-167 accept the marker anywhere in the line.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java)
No test binds `setBytea(int, InputStream, int)` or `setText(int, InputStream)`, or leaves a parameter unset. For both streams this returns `2 * n + 11`, 211 for 100 bytes, while the trace shows `?` and `('<stream of 100 bytes>')`, so the Javadoc's "lower bound on rendered log size" and "raw bytes for binary payloads" no longer describe the code. The same `bytea` stream is logged as `$1=<?>` at the default limit and as `$1=<<100 bytes>>` at 120. Please make the Javadoc match the code, log a `bytea` stream the same way at every limit, and add a `BindLogTest` case for each of these value kinds with the exact expected line.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java)
The whole result is known: `abcdef...(truncated)` here, and `pre:ab...(truncated)` in `appendBoundedTruncates`. Please replace the length, `endsWith`, and `startsWith` checks in both tests with one `assertEquals` of the literal, so a failure prints the value.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
Each value and its `>,type=…` are appended past the limit, and this `truncate` then cuts the line wherever the limit falls. With the three parameters of `budgetExhaustionDoesNotLeaveDanglingParameterPrefix`, a limit of 119 gives `…,type=VARCHAR,$2=<...(truncated)`, 117 gives `…,type=VARCHAR,$2...(truncated)`, and 143 gives `…,$3=<...(truncated)`. The same cut discards the clean ending `appendQuotedStringPrefix` builds: a value of 50 `😀` at limit 54 gives `$1=<('` followed by a lone high surrogate and `...(truncated)`, and `"ab"` followed by 100 quotes at limit 56 gives `$1=<('ab'...(truncated)`, which reads as the complete value `ab`. One character below the full length, the line loses its `)` and gets no marker: 149 gives `…,$3=<('cc')>,type=VARCHAR`. Please reserve room for `>,type=…` and the marker before appending a value, and leave out a parameter when none of its value fits, so this `truncate` never cuts.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java)
The three limits are independent cases, and the first failure hides the other two. Please make this a `@ParameterizedTest` over `(limit, expected)`, named after the outcome, for example `aLimitNoLongerThanTheSuffixKeepsOnlyAPrefixOfTheSuffix`.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java:74)
No test covers a value that exactly fills the room left (`appendBounded(new StringBuilder("pre:"), "value", 9)` returns `true` and gives `pre:value`), room shorter than `TRUNCATION_SUFFIX` (`"pre:"` with a 26-character value and limit 10 gives `pre:...(tr`), or no room at all (limit 4 leaves `pre:` unchanged and returns `false`). `BindLog.format` reaches these branches when the limit is almost used up. Please add a case for each, asserting the return value and the exact buffer.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
The line above already asserts that the log is at most 256 characters, so it cannot contain a 500000-character string, and this assertion holds whatever the formatter does. The same is true at line 85. A formatter that calls `toString` on the value, or builds the whole literal, and discards the result passes both tests. Here the `toString` override can set a flag, and the test can assert that it stayed unset.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
With these three values, no limit reaches the check at `BindLog.java:49-55`: at `maxLen = 80` the first value is cut and the loop stops at line 43. The assertion looks only for a trailing `=<`, so it misses `,$2` and `,$2=` as well, and the next assertion accepts the marker anywhere in the line. Please replace this test with a parameterized one over the limits where the cut lands inside `,$i=<` and one character below and above each, plus the full length and one below it, asserting the exact expected line.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/util/internal/LogMessageUtils.java)
This check looks only at the neighboring characters, so in a run of quotes it moves a cut that falls between two pairs into the middle of one: `appendQuotedStringPrefix(new StringBuilder(), "''''", null, true, 7)` gives `(''...` instead of `('''...`. A doubled backslash under `standard_conforming_strings=off` is not checked at all. Please record where each escaped character starts while escaping, and cut only there. The `type` parameter is never used (`typeNameForCast` also returns `varchar` and `text`, casts `quoteAndCast` does not write), and lines 138-143 are an `if` with an empty body; please remove both. No test calls this method directly.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
This estimate shows values that fit as cut. `quoteAndCast` adds no cast for `VARCHAR` or `TEXT`, but `castExtra` counts `::VARCHAR`, and the factor 2 assumes every character is a quote. A 60-character `VARCHAR` followed by an `int4` makes a 144-character trace, yet at every limit from 144 to 169 the trace shows `$1=<('vvv…v...>`, with all 60 characters, `...` in place of the closing `')`, and, at 144, no `)`. Please compute the exact literal length instead: count the quotes, and the backslashes when `standard_conforming_strings` is off, in one pass, and add the cast `quoteAndCast` actually writes.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/logging.md)
Please make this a link: "See [maxLogMessageLength](/documentation/use/#connection-parameters)."
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332 (changes requested): fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
These points of the previous review are still open: the unbounded `SimpleQuery` trace, the test on a live connection, the negative `maxLogMessageLength`, the `CHANGELOG.md` entry, and the merge commit. `BindLogTest` still imports `assertEquals` without using it, and the new `LogMessageUtils` import in `QueryExecutorImpl` is out of order, so `autostyleJavaCheck` and `checkstyleMain` fail.
`README.md` lists connection properties in a table, and the other logging properties, `logServerErrorDetail` and `logUnclosedConnections`, have a row there. Please add a row for `maxLogMessageLength`.
Smaller points:
- The class comment of `BindLogTest` names the subject, not the rule the tests check. For example: "A Bind trace is never longer than `maxLogMessageLength`, and with no limit it matches the format logged before the limit existed."
- `logging.md` has two blank lines before `## Configuration`; one is enough.
- The test command in the PR description names `org.postgresql.util.LogMessageUtilsTest`; the class is now in `org.postgresql.util.internal`.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md:525)
Please add a `Since:` line with the release this goes into, in the form `maxSendBufferSize` uses. On 42.7.14 or earlier the property has no effect, and nothing on this page says so.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
The list of traces the property does not bound leaves out `FE=> SimpleQuery`, the trace that carries inlined parameter values with `preferQueryMode=simple`. While that trace stays unbounded, please add it here, in `logging.md`, and in the `PGProperty` Javadoc. Please also write these lists with commas and "or" instead of ` / ` and `/`, here, in `logging.md` ("Bind/Parse dumps"), in the `PGProperty` description, and in the `BaseDataSource` Javadoc.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
The entry does not say that the value is read when the connection opens, so changing it on a `DataSource` affects only new connections. Please say so and link to [Logging](/documentation/logging/).
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
"legacy unbounded behaviour" describes the previous version of the driver, and this page documents the current one. Please write what `0` does: "Set to `0` for no limit." The `BindLog.format` Javadoc has the same "(legacy behaviour)".
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
With a limit of 14 or less, the message is `...(truncated)` or a prefix of it, such as `...(t` for 5, and below 73 a Bind trace of an unnamed statement with several `int4` parameters does not show even the first one whole. Please state the smallest useful value, or reject smaller values.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: vlsi (@vlsi) @ 2026-10-14 06:22 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/PGProperty.java)
The project's word list in `AGENTS.md` asks for "limit" instead of "cap". Please use it in `logging.md` ("capped"), the class comments of `BindLog`, `LogMessageUtils`, and `BindLogTest`, the field comment in `QueryExecutorImpl`, the `stringValueForLog` Javadoc, the `@param maxLength` tags in `LogMessageUtils`, the test name `manyBindsAreCapped`, and the assertion messages in `BindLogTest`. In `BindLog`, replace "a hard length cap so large or numerous bind parameters cannot OOM the process" with what the limit does. Here, "Max length" should be "Maximum length", and the description, which tools show on one line, can drop the list of traces the property does not bound; `use.md` carries it.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
room for >,type= and the closing ) or marker is reserved before each value now, so the final truncate never cuts a parameter
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/BindLog.java)
now uses the exact literal length: counts quotes, backslashes when scs is off, and only the cast quoteandcast writes
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/util/internal/LogMessageUtils.java)
prefix now appends each escaped unit whole or not at all, dropped the unused type param and the empty if, added direct tests
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
replaced with a parameterized test over the cut points with exact expected lines
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
every bind test compares the whole line now
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/core/v3/BindLogTest.java)
unknown type test now asserts tostring is never called
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java)
javadoc matches the code, a bytea stream logs as ? at every limit, added cases for both streams and an unset param
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:39 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java:74)
added the exact fill, room shorter than the suffix and no room cases
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java)
one assertequals on the literal in both
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/test/java/org/postgresql/util/internal/LogMessageUtilsTest.java)
made it a parameterized test with that name
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md:525)
added since: 42.7.15
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
now says it is read when the connection opens and links to logging
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
simplequery is limited now so it moved to the bounded list, lists use commas and or
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
now says set to 0 for no limit
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/use.md)
documented that one int4 param needs 73 and below 100 leaves little of the trace
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on docs/content/documentation/logging.md)
made it a link
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
(on pgjdbc/src/main/java/org/postgresql/PGProperty.java)
limit instead of cap everywhere, maximum length, description trimmed to one line
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 07:40 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
simplequery trace is limited now, added a live connection test in extended and simple mode, negative limit is rejected, changelog entry and readme row added, unused import and import order fixed. the merge commit is still there, can rebase it out if you want
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-14 10:20 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-14 10:20 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
rebased on master, dropped merge commit, ptal
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-10-26 20:33 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-10-26 20:33 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
@sankalpsthakur renamed this.
^ permalink raw [nested|flat] 58+ messages in thread
* Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
@ 2026-11-13 14:05 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
56 siblings, 0 replies; 58+ messages in thread
From: sankalpsthakur (@sankalpsthakur) @ 2026-11-13 14:05 UTC (permalink / raw)
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Squashed to one commit on master (6040183). The SimpleQuery trace is now bounded, the live-connection test covers extended and simple mode, a negative maxLogMessageLength is rejected, the CHANGELOG and README rows are in, and there is no merge commit. CI needs a workflow approval to run.
^ permalink raw [nested|flat] 58+ messages in thread
end of thread, other threads:[~2026-11-13 14:05 UTC | newest]
Thread overview: 58+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-01 09:16 [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-08-01 09:34 ` "davecramer (@davecramer)" <noreply+davecramer@github.com>
2026-08-01 11:54 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-08-16 04:42 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-12 17:07 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` Re: [pgjdbc/pgjdbc] PR #4332 (changes requested): fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 02:52 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 04:56 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` Re: [pgjdbc/pgjdbc] PR #4332 (changes requested): fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 06:22 ` "vlsi (@vlsi)" <noreply+vlsi@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:39 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 07:40 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-14 10:20 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-10-26 20:33 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@github.com>
2026-11-13 14:05 ` "sankalpsthakur (@sankalpsthakur)" <noreply+sankalpsthakur@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