sd4324530 opened a new pull request, #4559: URL: https://github.com/apache/flink-cdc/pull/4559
## What is the purpose of this pull request? Upgrade the bundled HikariCP connection pool from `4.0.3` to `7.1.0` (latest). JIRA: https://issues.apache.org/jira/browse/FLINK-40783 Version `4.0.3` was pinned for JDK 8 compatibility, which is no longer a constraint since the project baseline moved to Java 11. Compatibility of `7.1.0` with this project was verified at the bytecode level before upgrading: - `7.1.0` ships Java 11 bytecode (class file major version 55, no multi-release variants), matching the project's `source/target = 11` baseline. - It only calls classic slf4j APIs (`Logger.debug/warn/error`, `LoggerFactory.getLogger`), so it remains binary compatible with the `slf4j-api 1.7.36` used by this project and shipped by the Flink runtime — no fluent-API (`atInfo()` etc.) usage that would break on slf4j 1.7.x. - Every API this project uses is unchanged in `7.1.0`, including the two internal classes relied upon: `HikariProxyConnection` (used by the overridden `PostgresConnection#connection()` for `instanceof` + `unwrap`) and `HikariPool.PoolInitializationException` (caught by `PooledDataSourceFactory`). ## Brief change log - Bump `com.zaxxer:HikariCP` from `4.0.3` to `7.1.0`. - Extract a `hikaricp.version` property in the root pom; the version was previously hardcoded in two places (`flink-cdc-base` and `flink-connector-mysql-cdc`). - Add the `slf4j-api` exclusion to the HikariCP dependency in `flink-cdc-base`, consistent with the existing declaration in `flink-connector-mysql-cdc`. - No Java code or shade/relocation configuration changes are required. Behavior note for reviewers: since HikariCP 6.2.1, `keepaliveTime` defaults to 2 minutes (previously disabled). Idle pool connections are now probed periodically, which generally protects long-running CDC jobs from silently dropped connections; the extra load is one ping per idle connection every 2 minutes. --- ## Verifying this change This change added no new tests; it was verified with existing test suites plus manual checks (all on JDK 11): - *Existing unit tests*: `flink-cdc-base` full test suite passes (31/31). - *Existing integration tests (Docker/Testcontainers)*: `MySqlSourceITCase` (64/64, MySQL 5.7) and `PostgresSourceITCase` (50 run, 0 failures, 1 skipped by its own `assumeThat` guard — PostgreSQL 14) pass. These cover the full snapshot + incremental pipeline through the HikariCP 7.1.0 pool, including the `HikariProxyConnection` instanceof/unwrap path in `PostgresConnection`. - *Manually tested fat jar outputs*: `flink-sql-connector-mysql-cdc`, `flink-sql-connector-postgres-cdc` and `flink-cdc-pipeline-connector-mysql` bundle HikariCP `7.1.0`; the `com.zaxxer` relocation is correctly applied where configured (0 unrelocated leaks), and the `module-info.class` newly added in 7.x is filtered by the existing global shade filter. - *Manually tested end-to-end runtime*: using the shaded classes from the fat jar with `slf4j-api 1.7.36` on JDK 11 against a real MySQL container — pool startup logging, DDL/DML/query, proxy `instanceof`/`unwrap`, `PoolInitializationException` path, pool MXBean stats and clean shutdown all behave correctly (no `NoSuchMethodError`). - *Manually verified the keepalive change*: default `keepaliveTime` reads 120000 ms, and idle connections do receive periodic `COM_PING` probes (observed via the server-side `Com_admin_commands` status counter). ## Documentation - Does this pull request introduce a new feature? (no) --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (Claude Code) Generated-by: Claude Code 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
