showuon commented on code in PR #11955: URL: https://github.com/apache/kafka/pull/11955#discussion_r859425060
########## connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java: ########## @@ -222,6 +223,14 @@ public void stop() { connectorStatusMetricsGroup.close(); workerConfigTransformer.close(); + executor.shutdown(); + try { + if (!executor.awaitTermination(EXECUTOR_SHUTDOWN_TERMINATION_TIMEOUT_MS, TimeUnit.MILLISECONDS)) { + executor.shutdownNow(); + } + } catch (InterruptedException e) { + executor.shutdownNow(); + } Review Comment: Not sure if we should follow the 2-phase shutdown in "usage example" in java doc? https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ExecutorService.html -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org