chore(core): Update netty lib, remove pgjdbc-ng and PostgresPubSubImpl (#37592) - #37593
Conversation
PostgresPubSubImpl was superseded by JDBCPubSubImpl (vanilla postgres driver, #26019) and DotPubSubProviderLocator has defaulted to it since. Nothing in the repo sets DOT_PUBSUB_PROVIDER_OVERRIDE to PostgresPubSubImpl, so the pgjdbc-ng code path was unreachable. pgjdbc-ng was the only remaining compile-scope, non-Azure/non-AWS source of Netty on the classpath, transitively bringing Netty 4.1.63 while langchain4j-azure-open-ai brought 4.1.118. Changes: - Delete PostgresPubSubImpl, PgNgDataSourceUrl and their tests - Deregister PostgresPubSubImplTest from MainSuite2a/MainSuite2b - Drop the pgjdbc-ng dependency from dotCMS/pom.xml and bom/application - Replace the codebase's only Netty import (io.netty.util.NetUtil in HttpRequestDataUtil#getIpAddress) with Guava InetAddresses.forString; Guava is already a direct compile dependency. The `throws UnknownHostException` signature is preserved because callers catch it. - Keep the six Netty BOM pins; Azure/reactor-netty still ship 4.1.112 vs 4.1.118 skew, and AWS still pulls 4.1.130. Update the stale comment. Netty remains on the classpath via azure-core-http-netty and the AWS SDK sqs netty-nio-client; only the 4.1.63 line disappears.
|
Claude finished @wezell's task in 1m 34s —— View job Code ReviewReviewed the full diff against
Verified:
New IssuesNo issues found.
Note: the |
…ble (#37592) DOT_PUBSUB_PROVIDER_OVERRIDE previously threw DotRuntimeException when the named class could not be loaded or constructed, so a stale override (e.g. pointing at a class from a dependency that is no longer shipped) prevented the node from starting. Now the locator logs a warning and falls back to JDBCPubSubImpl. The fallback covers a missing class, no no-arg constructor, a constructor that throws, and a class that does not implement DotPubSubProvider. If the fallback target is itself unusable the exception is rethrown, since there is nothing left to fall back to. Also replaces the deprecated Class.newInstance() with getDeclaredConstructor().newInstance(), and documents the fallback in dotmarketing-config.properties. Adds DotPubSubProviderLocatorTest (6 cases) covering each fallback path.
The six individual Netty pins only covered netty-common, netty-buffer, netty-transport, netty-resolver, netty-codec and netty-handler, so the rest of the tree still resolved to whatever each consumer asked for: reactor-netty brought netty-resolver-dns 4.1.112, azure-core-http-netty brought netty-codec-http2 4.1.132 and the awssdk netty-nio-client brought netty-transport-classes-epoll 4.1.130. Mixed Netty modules on one classpath fail at runtime with NoSuchMethodError. Replaces the six pins with an import of io.netty:netty-bom, which manages all 60 Netty artifacts - including the native transports, resolver-dns and tcnative - at a single version. Bumps 4.1.118.Final to the latest 4.1.x, 4.1.138.Final. Side effect: netty-tcnative-boringssl-static moves 2.0.70.Final -> 2.0.84.Final, the version netty-bom 4.1.138 pairs with. Verified via dependency:tree that every io.netty artifact now resolves to 4.1.138.Final and tcnative to 2.0.84.Final; dotcms-core compiles and its unit tests pass.
|
dotbot code review:
Removal of pgjdbc-ng/PostgresPubSubImpl is complete with no residual references, Netty BOM alignment covers all modules, Guava IP parsing preserves loopback fallback with no DNS, and soft-fallback to JDBCPubSubImpl is intentional, logged and tested. Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · meta/muse-spark-1.3 · medium |
|
dotbot code review:
The removal is complete: no residual references to pgjdbc-ng, PostgresPubSubImpl, PgNgDataSourceUrl, or NetUtil remain in build files or source. The new resolveProvider fallback logic is correct (it rethrows when the default provider itself fails, and tests cover all paths), the Guava InetAddresses swap preserves IP-literal parsing and the loopback fallback, and the Netty BOM import is a valid consolidation. Test suites were updated consistently. Tip: comment with "/dotbot address comments" to attempt automated fixes for unresolved review threads. reviewed by dotbot · ~z-ai/glm-latest · medium |
dotCMS-Machine-User
left a comment
There was a problem hiding this comment.
✅ dotbot review: all reviewer models (meta/muse-spark-1.3, ~z-ai/glm-latest) agree — patch is correct.
approved automatically by dotbot
Proposed Changes
PostgresPubSubImplandPgNgDataSourceUrl— dead code superseded byJDBCPubSubImpl(vanilla postgres driver, PubSubListener with vanilla postgres #26019).DotPubSubProviderLocatorhas defaulted toJDBCPubSubImplsince, and nothing in the repo setsDOT_PUBSUB_PROVIDER_OVERRIDEtoPostgresPubSubImpl.PostgresPubSubImplTestfromMainSuite2a/MainSuite2b(a stale entry there would compile but fail the suite).com.impossibl.pgjdbc-ng:pgjdbc-ngdependency fromdotCMS/pom.xmland its version frombom/application/pom.xml.io.netty.util.NetUtil.createByteArrayFromIpAddressString()inHttpRequestDataUtil#getIpAddress— with GuavaInetAddresses.forString(). Guava is already a direct compile dependency.throws UnknownHostExceptionis preserved because 6 call sites catch it.DOT_PUBSUB_PROVIDER_OVERRIDEfail soft: an override that cannot be loaded or constructed now logs a warning and falls back toJDBCPubSubImplinstead of throwingDotRuntimeExceptionat startup.io.netty:netty-bomimport, and bump 4.1.118.Final → 4.1.138.Final (latest 4.1.x).Checklist
Additional Info
Closes #37592. Follow-up to the pgjdbc-ng discussion on #37588.
Why:
pgjdbc-ngwas the only remaining compile-scope, non-Azure/non-AWS source of Netty, transitively bringing 4.1.63 whilelangchain4j-azure-open-aibrought 4.1.118. That conflict is what the six Netty BOM pins existed to paper over.Removing
PostgresPubSubImplis no longer a breaking change. Deployments that had pointedDOT_PUBSUB_PROVIDER_OVERRIDEat it now degrade toJDBCPubSubImplwith a warning instead of failing to start. The fallback covers:DotPubSubProviderAlso replaced the deprecated
Class.newInstance()withgetDeclaredConstructor().newInstance(), and documented the behaviour indotmarketing-config.properties.Netty version bump
The six individual pins only covered
netty-common/-buffer/-transport/-resolver/-codec/-handler, so the rest of the tree still resolved to whatever each consumer asked for:netty-common…netty-handlernetty-resolver-dns(reactor-netty)netty-codec-http2(azure)netty-transport-classes-epoll(awssdk)netty-tcnative-boringssl-staticImporting
netty-bommanages all 60 Netty artifacts at one version, which removes that skew — mixed Netty modules on a single classpath fail at runtime withNoSuchMethodError. Side effect: tcnative follows the BOM to 2.0.84.Final.CVEs addressed
The bump resolves all six Netty findings from the security scan. Every one is fixed in a version below where we now land (all Netty artifacts are 4.1.138.Final):
netty-codec-dnsnetty-resolver-dnsnetty-resolver-dnsnetty-codec-httpnetty-codec-httpnetty-handlerFixed versions checked against the NVD API (
services.nvd.nist.gov/rest/json/cves/2.0). Two entries disagree on severity with the scan output; recorded rather than reconciled.Worth stressing: before this bump the tree was not merely 4.1.118. The artifacts the six hand-written pins did not cover resolved to 4.1.112 (
netty-resolver-dns), 4.1.130 (netty-transport-classes-epoll) and 4.1.132 (netty-codec-http2) — all below the fix thresholds. Importingnetty-bomis what makes the remediation complete: bumping the six pins alone would have leftnetty-resolver-dnsat 4.1.112, still exposed to CVE-2026-47691 and CVE-2026-45674.CI status — all green
Every check passes, including
MainSuite 1a/1b/2a/2b/3a, all Postman splits, JVM unit tests, CLI/E2E/Karate, the AI review and the rollback-safety checks.The first run reported failures in
MainSuite 1a/1b/2a/2b/3a,Postman Default SplitandPostman Category Content. Those were flaky, not from this change: unrelated open PRs #37591 and #37589 were failing the identical suites on the same runners at the same time (#37589failed MainSuite 2a too), and simply re-running the failed jobs cleared every one of them. Observed causes were environmental —StoryBlockMapTestNPEs on a nullHttpSessionin the Velocity toolbox, andTask240306MigrateLegacyLanguageVariablesTest/ExperimentAPIImpIntegrationTesttiming out at ~65s. The logs also showdotpubsub.JDBCPubSubImpl - Starting to listen for Postgres notificationsrunning normally under this PR.Verification
dependency:tree→ everyio.nettyartifact resolves to 4.1.138.Final (16 modules), tcnative to 2.0.84.Final;pgjdbc-ngcount 0test -pl :dotcms-core -Dtest=DotPubSubProviderLocatorTest,HttpRequestDataUtilTest,CacheTransportTopicTest→ Tests run: 17, Failures: 0, Errors: 0test-compile -pl :dotcms-core→ BUILD SUCCESStest-compile -pl :dotcms-integration→ BUILD SUCCESS, 0 errors,MainSuite2a/MainSuite2bcompiledcom.impossibl.*,PostgresPubSubImpl,PgNgDataSourceUrl, orio.netty.utilb6a18e74b1) so it can be reverted independently if it needs backing out.Netty does not fully disappear — it stays on the classpath via
azure-core-http-netty(langchain4j) andnetty-nio-client(AWS SDK SQS).Behavioral notes
getIpAddresspreviously returned loopback (127.0.0.1) when the remote address was unparseable; that fallback is unchanged. Guava's parser accepts IPv4, IPv6 and scoped IPv6 (fe80::1%eth0), verified directly againstguava-32.0.1-jre.POSTGRES_PUBSUB_JDBC_URLand thejdbc:pgsql://URL scheme become unused after this change.Screenshots
N/A — backend/dependency change.
This PR fixes: #37592