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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java:
##########
@@ -231,6 +231,12 @@ private synchronized void onFailure(Throwable t) {
         if (this.state == State.FAILED)
             return;
 
+        // Call stop() on the connector to release its resources. Connector
+        // could fail in the start() method, which is why we call stop() on
+        // INIT state as well.
+        if (this.state == State.STARTED || this.state == State.INIT)
+            connector.stop();

Review Comment:
   > I think leaving the resources allocated when the connector is in the 
FAILED state until a restart is fine.
   
   I created a follow-up for releasing resources early here: 
https://issues.apache.org/jira/browse/KAFKA-16987 so we can focus on the 
startup leak in this PR.



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