yashmayya commented on code in PR #12478:
URL: https://github.com/apache/kafka/pull/12478#discussion_r960435913


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/errors/RetryWithToleranceOperator.java:
##########
@@ -269,7 +289,7 @@ void backoff(int attempt, long deadline) {
             delay = deadline - time.milliseconds();
         }
         log.debug("Sleeping for {} millis", delay);
-        time.sleep(delay);
+        return !exitLatch.await(delay, TimeUnit.MILLISECONDS);

Review Comment:
   Ah, that's a very good point! I didn't account for this because I had 
(incorrectly) assumed that if a thread's interrupt status is set and a 
`CountDownLatch` has already been counted down to 0, a call to 
`CountDownLatch::await` would return immediately with `true` (i.e. the latch's 
count would be given "priority" over the thread's interrupt status). However, 
this isn't actually the case and the call to `CountDownLatch::await` will 
instead immediately throw an `InterruptedException` 😄



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