zhangshenghang commented on PR #10337:
URL: https://github.com/apache/seatunnel/pull/10337#issuecomment-3755074462
<!-- code-pr-reviewer -->
**JdbcSink.java:1-340** — The class is missing an override of
`enhancedConfigurationValidator()`, so the `JdbcSinkEnhancedValidator`
implemented in this PR will never be invoked.
The framework calls `sink.enhancedConfigurationValidator()` at
`MultipleTableJobConfigParser.java:702`, and without the override it returns
`Optional.empty()`, skipping all validation. This renders the new validator
dead code and leaves config errors (e.g., enabling `use_copy_statement` on
MySQL) undetected until runtime.
**ElasticSearchCatalog.java:108-110** — `getServiceVersion()` creates a new
`EsRestClient` when `esRestClient == null`, while
`DefaultEnhancedConfigurationValidator.detectCurrentServiceVersion()` calls
`catalog.open()` afterward in a try-with-resources block.
This can create two client instances and leak the first one. Consider adding
a state check:
```java
if (esRestClient == null) {
throw new IllegalStateException("Catalog must be opened before calling
getServiceVersion()");
}
```
--
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]