From: sankalpsthakur (@sankalpsthakur) <noreply+sankalpsthakur@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #4332: fix: limit FINEST Bind, Parse and SimpleQuery log messages to maxLogMessageLength to avoid OOM
Date: Sat, 01 Aug 2026 11:54:55 +0000
Message-ID: <gh-pgjdbc-pgjdbc-4332-c5151308441@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-4332@github.com>
References: <gh-pgjdbc-pgjdbc-4332@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.