gharris1727 commented on code in PR #14763:
URL: https://github.com/apache/kafka/pull/14763#discussion_r1456550693


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:
##########
@@ -812,6 +812,7 @@ public void stop() {
         ThreadUtils.shutdownExecutorServiceQuietly(herderExecutor, 
herderExecutorTimeoutMs(), TimeUnit.MILLISECONDS);
         ThreadUtils.shutdownExecutorServiceQuietly(forwardRequestExecutor, 
FORWARD_REQUEST_SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS);
         ThreadUtils.shutdownExecutorServiceQuietly(startAndStopExecutor, 
START_AND_STOP_SHUTDOWN_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+        stopServices();

Review Comment:
   I changed this to move the stopServices from stop() to the `catch` block in 
run. This is because `finally` doesn't execute if exit() is called in the catch 
block, which is typical when in production.
   
   I moved the stop/close for all of the non-started resources to 
closeResources, which is always called even if stopServices() throws. Before 
herderMetrics and member were only closed on the halt() happy-path, now they 
are called if an exception kills the herder thread too.



-- 
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

Reply via email to