You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/04/23 04:28:26 UTC

[GitHub] [kafka] C0urante commented on a change in pull request #8069: KAFKA-9374: Make connector interactions asynchronous

C0urante commented on a change in pull request #8069:
URL: https://github.com/apache/kafka/pull/8069#discussion_r413499718



##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java
##########
@@ -263,17 +267,20 @@ public boolean startConnector(
                 Plugins.compareAndSwapLoaders(savedLoader);
                 workerMetricsGroup.recordConnectorStartupFailure();
                 statusListener.onFailure(connName, t);
-                return false;
+                onConnectorStateChange.onCompletion(t, null);
+                return;
             }
+            workerConnector.transitionTo(initialState, onConnectorStateChange);

Review comment:
       This part still needs some work; it's in an inconsistent state because I modified `Worker::startConnector` to have no return value and instead communicate all success or failure of the connector startup through the callback, but haven't taken care of issues like possibly invoking the callback twice (once in this method, and once in the `WorkerConnector` instance), making sure to swap plugin classloaders at the right times, and preventing a possible race with the check to see if the connector already exists based on whether its name is present as a key in the `connectors` map.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org