fhan688 commented on code in PR #20271:
URL: https://github.com/apache/hudi/pull/20271#discussion_r4255728602
##########
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/transaction/ConnectTransactionCoordinator.java:
##########
@@ -131,25 +137,17 @@ public void start() {
}
@Override
- public void stop() {
- kafkaControlClient.deregisterTransactionCoordinator(this);
- scheduler.shutdownNow();
+ public synchronized void stop() {
hasStarted.set(false);
- if (executorService != null) {
- boolean terminated = false;
- try {
- log.info("Shutting down executor service.");
- executorService.shutdown();
- log.info("Awaiting termination.");
- terminated = executorService.awaitTermination(100,
TimeUnit.MILLISECONDS);
- } catch (InterruptedException e) {
- // ignored
+ try {
+ if (!deregistered) {
+ kafkaControlClient.deregisterTransactionCoordinator(this);
+ deregistered = true;
}
-
- if (!terminated) {
- log.warn(
- "Unclean Kafka Control Manager executor service shutdown ");
- executorService.shutdownNow();
+ } finally {
+ if (!shutdownInitiated) {
+ shutdownInitiated = true;
+ shutdownEventLoop();
Review Comment:
Thanks for catching this. I moved the terminated-executor cleanup fallback
out of `shutdownEventLoop()` so subsequent `stop()` calls can retry a failed
`transactionServices.close()`. I also added a regression test covering timeout
→ delayed loop exit → first close failure → repeated stop cleanup.
--
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]