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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/errors/RetryWithToleranceOperator.java:
##########
@@ -168,22 +170,26 @@ public synchronized <V> V execute(Operation<V> operation, 
Stage stage, Class<?>
      * @throws Exception rethrow if a non-retriable Exception is thrown by the 
operation
      */
     protected <V> V execAndRetry(Operation<V> operation) throws Exception {
+        RetriableException lastException = null;
         int attempt = 0;
         long startTime = time.milliseconds();
         long deadline = (errorRetryTimeout >= 0) ? startTime + 
errorRetryTimeout : Long.MAX_VALUE;
         do {
+            if (stopping) {
+                log.trace("Shutdown has been scheduled. Marking operation as 
failed.");
+                context.error(new ConnectException(lastException));
+                return null;
+            }

Review Comment:
   Fair enough, I guess we don't need to worry too much about getting stopped 
before the first attempt.



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