You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/04/09 23:12:49 UTC

[GitHub] [kafka] kkonstantine commented on a change in pull request #10503: KAFKA-9988: Suppress uncaught exceptions in log messages during task shutdown

kkonstantine commented on a change in pull request #10503:
URL: https://github.com/apache/kafka/pull/10503#discussion_r610945519



##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java
##########
@@ -185,8 +185,16 @@ private void doRun() throws InterruptedException {
 
             execute();
         } catch (Throwable t) {
-            log.error("{} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted", this, t);
-            throw t;
+            if (!stopping && !cancelled) {

Review comment:
       Should we just write this as: 
   ```
   if (cancelled) {
   } else if(stopping) {
   } else {
   }
   ```
   ?
   Should be equivalent but a bit easier to follow. 




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