You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "waterWang (via GitHub)" <gi...@apache.org> on 2026/08/12 03:01:24 UTC
[PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
waterWang opened a new pull request, #11771:
URL: https://github.com/apache/seatunnel/pull/11771
### Purpose
Fix the JDBC sink HikariCP connection pool ignoring the `connection-test-query` configured by users in the `properties` block.
### Root Cause
When users configure a connection test query via `properties.connection-test-query` (or `properties.connectionTestQuery`), the current code passes it to the JDBC DataSource via `HikariDataSource.addDataSourceProperty()`. HikariCP pool properties are silently ignored when passed as DataSource properties — the `setConnectionTestQuery()` method must be used instead. This means the connection test query never takes effect during long-running streaming jobs, leading to `No operations allowed after statement closed` errors when the MySQL server closes idle connections.
### Changes
- Extended `JdbcSinkWriter.applyConnectionValidation()` to check the user's `properties` config for `connectionTestQuery` and `connection-test-query` keys
- When found, applies them to the HikariCP pool via `setConnectionTestQuery()` directly
### Related issue
Closes #11769
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11771:
URL: https://github.com/apache/seatunnel/pull/11771#issuecomment-6339479989
Thanks for your patience. The upstream status has changed since my preceding note: [#12938](https://github.com/apache/seatunnel/pull/12938) merged into `dev` at 2026-10-22 10:26 UTC (merge `cc54bb433357b4cb45db9cd5d0743589c3111b79`). I checked that current dev contains the merge and that its diff restores the historical `AbstractMultiCatalogTransform` serialization UID and makes the construction-only config transient. My earlier instruction to wait for that fix is now superseded.
The archived-wrapper `LLMBooleanOutputTest.readsLegacyFactoryWrapperWithValidationDisabled` / `InvalidClassException` is the shared unit-test failure identified in the preceding review ([affected job](https://github.com/waterWang/seatunnel/actions/runs/39385801789/job/118536069689)). This head is still `f8108da0574495e8b564db7755aa50cd8e6c6c98`; the current `dev` comparison is `diverged`, ahead 3 / behind 12. Please sync with the latest `dev` and rerun the affected unit checks first, plus any stage whose log showed the same archived-wrapper error. Keep unrelated transform-serialization patches out of this PR. This is a targeted remedy for that known upstream failure, not a claim that syncing fixes every failed stage.
Other failed job families in the same head's run are `edge-agent-it`, `mysql-cdc-connector-it`. Their causes/results remain separate; this upstream patch does not establish that they pass. My previous source-level conclusion is unchanged. Required CI and the final write-capable maintainer review remain gates. This is a CI-status follow-up only, with no new source findings or fresh full-review claim.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11771:
URL: https://github.com/apache/seatunnel/pull/11771#issuecomment-5340998320
Hi @waterWang, thanks for joining the Slack channel!
Quick status update since there's no new commit yet: the root-cause diagnosis and the fix itself are correct and safely backward compatible — nice work tracing it down to `applyConnectionValidation()`. Two items from my previous review are still blocking merge:
1. **CI (High, currently the literal reason the `Code style` check is red)** — `spotless:check` is failing on the new Javadoc line-wrapping in `JdbcSinkWriter.java`. Running `./mvnw spotless:apply -pl seatunnel-connectors-v2/connector-jdbc -am -nsu` locally and pushing the reformatted file should clear it.
2. **Test coverage (Medium)** — `JdbcSinkWriterTest` already has two tests that call `applyConnectionValidation(dataSource, jdbcConnectionConfig)` directly and assert on `getConnectionTestQuery()`; adding one more case covering the new `properties.connectionTestQuery` / `connection-test-query` branch would be a very small, almost copy-paste addition given that existing template.
The remaining notes from my review (extracted key still double-applied via `addDataSourceProperty`, and the fact that `JdbcConnectionValidationUtils` — used by `JdbcOutputFormat.shouldRefreshExecutor()` and others — still doesn't see this override) are non-blocking and fine to leave as a possible fast-follow; they don't need to hold up this PR.
Whenever you get a chance to push the Spotless fix and the test, I'll re-review right away. Thanks again for digging into #11769!
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11771:
URL: https://github.com/apache/seatunnel/pull/11771#issuecomment-5283076200
Thanks for your contribution! This is a solid addition to the project, and your attention to detail really shows. Contributors like you are what keep this community moving forward. Feel free to keep the PRs coming — we're always glad to have you here!
Please ignore the following message if you have joined in the Slack~
```
To facilitate focused communication among contributors, we’ve created a brand-new dedicated #contributors channel in official Slack workspace.
Slack workspace link: https://s.apache.org/seatunnel-slack
This channel is designed for technical discussions, feature design brainstorming, roadmap sync and direct communication with project core Contributors. Everyone who contributes code, docs, test cases or community ideas is warmly invited to join, share thoughts and collaborate together under The Apache Way. Welcome to join 😄
```
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11771:
URL: https://github.com/apache/seatunnel/pull/11771#issuecomment-6285610892
Pushed `f8108da0574` on top of your branch, @waterWang (merge of the current `dev` plus one commit) to close the two blocking items from my review:
1. `./mvnw spotless:apply -pl seatunnel-connectors-v2/connector-jdbc` applied, which fixes the Javadoc wrapping in `JdbcSinkWriter.java` that made the `Code style` check red (`spotless:check` now passes for the module locally).
2. `JdbcSinkWriterTest.testApplyConnectionValidationHonorsPropertiesConnectionTestQuery` covers both `properties.connection-test-query` and `properties.connectionTestQuery`, asserting that `getConnectionTestQuery()` returns the user query; it fails on `dev` without this PR's branch in `applyConnectionValidation`.
No production logic changed. Your fork did not create a Build run for this push; if none appears, please start one from the Actions tab ("Run workflow" on Build). I started a verification run of the same head on my fork: https://github.com/DanielLeens/seatunnel/actions?query=branch%3Apr11771-verify-f8108da0574
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix][Connector-V2] Honor connection-test-query from properties config in JDBC sink HikariCP pool [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11771:
URL: https://github.com/apache/seatunnel/pull/11771#issuecomment-6338053003
A CI-status correction on unchanged head `f8108da0574495e8b564db7755aa50cd8e6c6c98`: my previous note described a queued/pending Build. The current [Build](https://github.com/apache/seatunnel/runs/118518590557) is now **failure**, so the old pending guidance is obsolete. Failed job families: `Run / unit-test`, `Run / edge-agent-it`, `Run / mysql-cdc-connector-it`.
Concrete inspected log evidence (one representative JDK/OS per failed family; this does not claim every matrix leg has the identical cause):
- [Run / unit-test (11, ubuntu-latest)](https://github.com/waterWang/seatunnel/actions/runs/39385801789/job/118536069689): `LLMBooleanOutputTest.readsLegacyFactoryWrapperWithValidationDisabled` fails with `InvalidClassException` on `AbstractMultiCatalogTransform`.
- [Run / edge-agent-it (11, ubuntu-latest)](https://github.com/waterWang/seatunnel/actions/runs/39385801789/job/118536070591): `LLMBooleanOutputTest.readsLegacyFactoryWrapperWithValidationDisabled` fails with `InvalidClassException` on `AbstractMultiCatalogTransform`.
- [Run / mysql-cdc-connector-it (17, ubuntu-latest)](https://github.com/waterWang/seatunnel/actions/runs/39385801789/job/118536071399): failed case(s): `testMysqlCdcInitialStartupWithLatestStop{TestContainer}[1]`.
Upstream/next-step check:
The archived LLM fixture is tracked in #12929; proposed fix #12938 remains open. Latest `dev` (`99ea16b9d6bdce452d4c4955581ccc7236a81bbd`) still has no explicit historical UID on `AbstractMultiCatalogTransform`. Syncing today will not fix that observed failure. Once the fix lands in `dev`, sync and rerun the affected failed jobs. Keep unrelated transform-serialization changes out of this PR.
My previous source-level conclusion remains unchanged: no outstanding source blocker from my side. This is a CI-status follow-up, not a fresh full code review or formal approval. The branch is ahead 3, behind 10, compare `diverged` against `dev`; this drift is recorded independently, not used as a generic sync request. A successful required Build and write-capable maintainer approval remain merge gates. Thanks for the contribution and for keeping the fix focused.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org