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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java:
##########
@@ -2212,6 +2212,13 @@ DistributedHerderRequest addRequest(Callable<Void> 
action, Callback<Void> callba
     DistributedHerderRequest addRequest(long delayMs, Callable<Void> action, 
Callback<Void> callback) {
         DistributedHerderRequest req = new 
DistributedHerderRequest(time.milliseconds() + delayMs, 
requestSeqNum.incrementAndGet(), action, callback);
         requests.add(req);
+        // We don't need to synchronize here
+        // If the condition evaluates to true, we can and should trigger a 
wakeup
+        // If it evaluates to false because our request has suddenly been 
popped off of the queue, then
+        //     the herder is already running the request and no wakeup is 
necessary

Review Comment:
   Was hoping to make the separation between the different conditions clearer 
(sort of but not quite like how we indent if/else chains in Java). Guess that 
doesn't read well; I've removed the extra indentation here.



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