Repository navigation
Bump commons-pool2 to 2.13.1 - #605
Open
tonygermano wants to merge 2 commits into
Open
tonygermano wants to merge 2 commits into
tonygermano wants to merge 2 commits into
Conversation
Cover how FileConnector uses its connection pool when a File Writer does not keep connections open: - destroying a connection does not open another one - a connection whose destroy fails while creating a replacement is still dropped from the connector's open connections, so disconnect() does not reach it again - a pooled connection that is no longer connected is destroyed and replaced by getConnection, and only the replacement is tracked as open The tests pass with commons-pool2 2.3. The first two fail with 2.13.1, where invalidateObject always tries to add a replacement object to the pool (POOL-424), so they guard the upgrade. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Tony Germano <tony@germano.name>
Since 2.13.0, GenericObjectPool.invalidateObject always tries to add a replacement object to the pool (POOL-424). In 2.3 it created one only when a thread was waiting to borrow. A File Writer that does not keep connections open destroys its connection with invalidateObject after every message, so on 2.13 it would open another FTP, SFTP, SMB, WebDAV or S3 connection that nothing uses, until the evictor closes it. If opening that connection failed, invalidateObject threw before FileConnector dropped the destroyed connection from its open connections, so a later disconnect() reached it again. When a File Writer does not keep connections open, its pool now has maxIdle 0, and destroyConnection returns the connection instead of invalidating it. returnObject destroys a connection the pool has no idle capacity for, and creates a replacement only for a waiting thread, which is what invalidateObject did in 2.3. maxIdle 0 with invalidateObject alone would leave waiting threads blocked, because addObject respects maxIdle since 2.13.0 (POOL-425). Connections are not validated on return in this mode, since they are destroyed anyway; validation on borrow is unchanged. File Readers and writers that keep connections open still use invalidateObject. The open connection is now dropped in a finally block, so a failure in the pool can't leave it behind. Use the Duration setters for the eviction settings, since 2.13.1 deprecates setTimeBetweenEvictionRunsMillis and setMinEvictableIdleTimeMillis. A zero interval still disables the evictor. The verification metadata drops commons-pool2 2.3 and its parent POM, commons-parent 34, which nothing else uses. The 2.13.1 parent, commons-parent 93, is already listed. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Tony Germano <tony@germano.name>
tonygermano
requested review from
NicoPiel,
jonbartels,
kpalang and
mgaffigan
November 26, 2026 13:35
tonygermano
marked this pull request as draft
November 26, 2026 13:58
tonygermano
force-pushed
the
build/commons-pool2-2.13
branch
from
November 26, 2026 14:07
bbdf29e to
a765d68
Compare
tonygermano
marked this pull request as ready for review
November 26, 2026 14:24
tonygermano
added a commit
to tonygermano/engine
that referenced
this pull request
Nov 26, 2026
Nothing runs the plugin: no workflow, task or document invokes dependencyCheckAggregate. Gradle still resolves its classpath on every invocation: 93 artifacts (Lucene, H2, Jackson 2.21, Guava 33, httpclient5, ...) that exist only for it, and that make up the first fetch in Renovate's artifact step, where the Maven Central 429 failures occur. Removing it cuts the downloads per run; it does not eliminate the rate-limit risk. Remove the plugin, its configuration block, its catalog entry (and the now-empty [plugins] table) and the report-file ignore patterns. What is lost: dependency-check was the only scan covering the vendored jars without Maven coordinates. Renovate's OSV alerts only cover catalog entries. A replacement scanner is a separate follow-up. Verification metadata: --write-verification-metadata only merges into an existing file and never prunes, so the set the build needs was found by deleting the file and regenerating it with a cold cache and CI's flags. The committed file is main's file minus the 115 entries nothing needs: the plugin's classpath and its parent POMs and BOMs. Two unneeded entries stay to avoid a conflict with the adjacent hunks of the commons-pool2 bump in OpenIntegrationEngine#605: commons-pool2 2.13.0 and org.apache.commons:commons-parent:33 (stale since a178dfb). 21 entries the plugin brought in stay because the mybatis 3.5.19 and HikariCP 7.1.0 parent chains now import them; without them a cold build fails verification on 🫏runtimeClasspath. The regeneration also wanted to add 19 transitives of 🫏testFixturesRuntimeClasspath, which the non-transitive list does not cover; they appear on untouched main too and a normal build does not resolve them, so they are left for a separate fix. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Tony Germano <tony@germano.name>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the
commons-pool2bump that was split out of #545. On 2.13, a File Writer that doesn't keep connections open would open an extra connection after every message, so the bump comes with a File connector fix.The regression
Since 2.13.0,
GenericObjectPool.invalidateObjectalways tries to add a replacement object to the pool (POOL-424). In 2.3 it created one only when a thread was waiting to borrow.FileDispatchercallsFileConnector.destroyConnection, and through itinvalidateObject, after every message when "Keep connection open" is off. The UI default is on. On 2.13 that would open another FTP, SFTP, SMB, WebDAV or S3 connection that nothing uses, until the evictor closes it about a second later.If opening that connection failed, for example while the server is down,
invalidateObjectthrew beforeFileConnectordropped the destroyed connection from its set of open connections, so a later halt would calldisconnect()on it again.FileDispatcherignores the exception.The fix
maxIdle0, anddestroyConnectioncallsreturnObjectinstead ofinvalidateObject. With no idle capacity,returnObjectdestroys the connection and creates a replacement only for a thread waiting to borrow, which is whatinvalidateObjectdid in 2.3.maxIdle0 withinvalidateObjectalone isn't enough: since 2.13.0,addObjectrespectsmaxIdle(POOL-425), so a waiting thread would never get a connection.NOOPor SFTPcdper message. Validation on borrow is unchanged.invalidateObject. Giving reader poolsmaxIdle0 would make them reconnect on every release within a poll.destroyConnectiondrops the connection from the open set in afinallyblock, so a failure in the pool can't leave it behind.Durationsetters, since 2.13.1 deprecates the...Millisones.Writers that use the
FILEscheme, including network shares mounted into the local filesystem, aren't affected either way: aFileConnectionholds no network connection.Tests
The first commit adds
FileConnectorConnectionPoolTest, which passes on 2.3:getConnectionreplaces a connection that is no longer connected, and tracks only the replacement as openThe first two fail on 2.13.1 without the fix, so they guard the upgrade.
Other changes in 2.4 to 2.13.1
From the changelogs of every release between 2.3 and 2.13.1, nothing else changes how we use pool2 in
FileConnectororKeyEncryptor. No APIs we use were removed, there are no new runtime dependencies, and the minimum Java version is 8.Verification metadata
The metadata drops commons-pool2 2.3 and its parent POM, commons-parent 34, which nothing else uses, and adds 2.13.1. Its parent, commons-parent 93, is already listed. The commons-pool2 2.13.0 entry stays: the dependency-check Gradle plugin uses it through commons-dbcp2.
Claude checked:
./gradlew clean buildpasses (941 tests)getConnection's fallback for a disconnected connection is removedFileConnectorchange logged 20Release notes
The bundled Apache Commons Pool library (commons-pool2) is updated from 2.3 to 2.13.1.
File Writer connection handling is unchanged. Plugins that use commons-pool2 should check the commons-pool2 changes: for example,
GenericObjectPool.invalidateObjectnow always tries to create a replacement object (POOL-424), and several...Millisconfiguration methods are deprecated in favor ofDurationversions.🤖 Drafted with Claude Code