fxbing opened a new pull request, #4570: URL: https://github.com/apache/flink-cdc/pull/4570
## What is the purpose of this pull request? Fluss schema operations create and close a connection for each lookup or DDL. Waiting for the Netty event loop to shut down adds repeated delays to multi-table initialization. This PR reuses the metadata clients for the applier lifecycle. JIRA: https://issues.apache.org/jira/browse/FLINK-40966 ## Brief change log - Lazily create transient Connection/Admin instances and reuse them for schema lookups and DDL; release both on close. - Stop coordinator events and schema workers before closing the metadata applier. - Add real-client tests for reuse, serialization, instance isolation and cleanup after schema errors; cover coordinator shutdown ordering and deferred cleanup after a worker timeout. ## Verifying this change - Verified the new client lifecycle and coordinator shutdown regressions fail against the original implementation and pass with the fix. - Java 11 / Flink 1.20.3: 100 focused runtime schema tests and 21 Fluss tests passed. A clean reactor run also passed all 19 coordinator tests and the 21 Fluss tests. - Java 17 / Flink 2.2.0: 84 focused runtime tests and the same 21 Fluss tests passed (`-Pflink2`). - The new lifecycle ITCase uses a real Fluss cluster and client threads; no dependencies were added. Focused command (Java 11): ```sh mvn -o -pl flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-fluss -am \ -Dtest=FlussMetadataApplierTest,FlussMetadataApplierLifecycleITCase,FlussEventSerializationSchemaTest,FlussSinkITCase#testWrongTableOptions,SchemaCoordinatorTest \ -Dsurefire.failIfNoSpecifiedTests=false clean test ``` For Java 17 / Flink 2.2, use `-Pflink2`, add `ExistingTableSchemaExpanderTest` to the test selection, and run `package -DskipITs` after cleaning. Packaging is required by the profile's reactor JAR-copy step. The selected lifecycle ITCase is explicitly executed by Surefire. ## Documentation - Does this pull request introduce a new feature? No. - If yes, how is the feature documented? Not applicable. ##### Was generative AI tooling used to co-author this PR? - [X] Yes — OpenAI Codex Generated-by: OpenAI Codex -- 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]
