davidzollo opened a new pull request, #11567: URL: https://github.com/apache/seatunnel/pull/11567
### Purpose of this pull request Elasticsearch multi-table sink currently constructs one EsRestClient for every table writer. The low-level client owns reactor and I/O dispatcher threads, so jobs with thousands of tables can create thousands of clients and exhaust native memory, file descriptors, and thread capacity. This patch: - lazily creates REST clients through the sink-task MultiTableResourceManager; - shares one client and cached cluster metadata across writers with identical hosts, authentication, and TLS settings; - preserves separate clients when table placeholders produce different connection settings; - keeps table-specific serializers, indices, batches, and retry state isolated; - preserves standalone writer eager initialization and ownership; - closes all partially initialized clients if multi-table writer construction fails. ### Does this PR introduce _any_ user-facing change? Yes. Multi-table Elasticsearch jobs use one REST client per distinct connection configuration in each sink subtask instead of one client per table writer. Connector configuration and write semantics are unchanged. ### How was this patch tested? Added focused unit tests covering: - different table indices with identical connection settings share one client; - different credentials keep clients isolated; - table writers do not close shared clients and the manager closes each client exactly once; - partial connection-group initialization and serializer initialization failures release every cached client; - standalone writers retain eager initialization and client ownership. Local formatting validation: `./mvnw spotless:apply -pl seatunnel-connectors-v2/connector-elasticsearch -am -nsu -Dmaven.gitcommitid.skip=true` Result: BUILD SUCCESS. Per the project workflow for this task, compilation, unit tests, and E2E validation are delegated to GitHub CI at the current PR head. ### Check list * [x] No new Jar binary package is added. * [x] Documentation changes are not necessary because no option or user workflow changes. * [x] `incompatible-changes.md` is not necessary because configuration and write semantics remain compatible. * [x] Connector registration, distribution POM, label scope, plugin config, and E2E registration are not applicable because this patch changes an existing connector implementation only. -- 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]
