C0urante commented on code in PR #16451:
URL: https://github.com/apache/kafka/pull/16451#discussion_r1664292432


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:
##########
@@ -363,7 +364,17 @@ public DistributedHerder(DistributedConfig config,
 
     @Override
     public void start() {
-        this.herderExecutor.submit(this);
+        Future<?> future = this.herderExecutor.submit(this);
+        try {
+            future.get(6, TimeUnit.SECONDS);
+        } catch (TimeoutException timeoutException) {
+            log.error("herder work thread timeout:", timeoutException);
+            future.cancel(true);
+        } catch (InterruptedException interruptedException) {
+            Thread.currentThread().interrupt();
+        } catch (ExecutionException executionException) {
+            log.error("herder work thread execution exception:", 
executionException);

Review Comment:
   We don't want to change `start` to block. Can we save the future in a field 
in this class, then expose something like a `Future<?> herderTask()` method 
that allows testing code to access that future and, if desired, block on it?



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

Reply via email to