cadonna commented on code in PR #12771:
URL: https://github.com/apache/kafka/pull/12771#discussion_r1009441403


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:
##########
@@ -810,10 +810,19 @@ private void transitRestoredTaskToRunning(final Task task,
     }
 
     private void addTasksToStateUpdater() {
+        final Map<TaskId, RuntimeException> taskExceptions = new 
LinkedHashMap<>();
         for (final Task task : tasks.drainPendingTaskToInit()) {
-            task.initializeIfNeeded();
-            stateUpdater.add(task);
+            try {
+                task.initializeIfNeeded();
+                stateUpdater.add(task);
+            } catch (final RuntimeException e) {
+                // need to add task back to the bookkeeping to be handled by 
the stream thread
+                tasks.addTask(task);

Review Comment:
   Regarding the guarantee of not processing corrupted tasks, I think we should 
be safe since `maybeThrowTaskExceptions()` immediately throws the encountered 
exceptions. I just dislike the fact that we rely on the exceptions bubbling up 
all the way up to `StreamThread#runLoop()` which might be broken by future 
changes.   



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