rhauch commented on a change in pull request #9669:
URL: https://github.com/apache/kafka/pull/9669#discussion_r534489037



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
##########
@@ -206,16 +203,13 @@ public void cancel() {
     public void stop() {
         super.stop();
         stopRequestedLatch.countDown();
-        synchronized (this) {
-            if (finishedStart)
-                tryStop();
-            else
-                startedShutdownBeforeStartCompleted = true;
-        }
     }
 
-    private synchronized void tryStop() {
-        if (!stopped) {
+    // Note: This method is not thread-safe

Review comment:
       Yeah, it's unclear whether to keep the `tryStop()` method to minimize 
deltas, or remove it to simplify things. +1 for simplifying things by moving 
the logic into `close()`.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to