qiuyanjun888 opened a new pull request, #4462:
URL: https://github.com/apache/flink-cdc/pull/4462
## Summary
- Remove production references to Flink's shaded Guava 31 classes from
`flink-cdc-base` incremental source fetcher paths.
- Replace `ThreadFactoryBuilder` usage with a small JDK-only daemon thread
factory.
- Replace `Lists.partition` usage with a local JDK-only partition helper.
- Add a regression test that blocks shaded Guava 31 classes and scans
compiled production classes for shaded-Guava references.
## Root Cause
FLINK-39429 reports `NoClassDefFoundError` for
`org/apache/flink/shaded/guava31/...` when running CDC with Flink 2.2. The
`flink-cdc-base` production classes referenced Flink's shaded Guava 31 package
directly, but that package is not available in the reported runtime environment.
## Fix
- Use JDK-only `ThreadFactory` implementations in:
- `IncrementalSourceStreamFetcher`
- `IncrementalSourceScanFetcher`
- `SnapshotSplitAssigner`
- Use a JDK-only `partition(...)` helper in `IncrementalSourceEnumerator`.
- Add `IncrementalSourceFetcherDependencyTest` to prevent shaded Guava 31
references from returning in `flink-cdc-base` production classes.
## Validation
- `mvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am
-Pflink2 -Dtest=IncrementalSourceFetcherDependencyTest -DfailIfNoTests=false
-Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dcheckstyle.skip
-Drat.skip=true -Dspotless.check.skip=true -Dmdep.skip=true test`
- `mvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am
-Pflink2 -Dtest='!SplitKeyUtilsTest,!FinishedSnapshotSplitInfoTest'
-DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DskipITs
-Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Dmdep.skip=true
test`
- `mvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am
-Pflink2 -DskipTests -Drat.skip=true -Dmdep.skip=true verify`
Note: the broader module test command excludes two known Java 17 Mockito
blocker tests (`SplitKeyUtilsTest`, `FinishedSnapshotSplitInfoTest`) that are
unrelated to this change.
## Jira
https://issues.apache.org/jira/browse/FLINK-39429
## Reviewers
cc @leonardBang @haruki-830 — you recently reviewed/authored changes
touching this area.
## AI Assistance Disclosure
This PR was prepared with AI-assisted tooling and manually validated with
the commands above.
--
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]