lucasbru commented on code in PR #12795: URL: https://github.com/apache/kafka/pull/12795#discussion_r1012833678
########## streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java: ########## @@ -395,8 +395,10 @@ private void createNewTasks(final Map<TaskId, Set<TopicPartition>> activeTasksTo tasks.addActiveTasks(newActiveTasks); tasks.addStandbyTasks(newStandbyTask); } else { - tasks.addPendingTaskToInit(newActiveTasks); - tasks.addPendingTaskToInit(newStandbyTask); + final Map<TaskId, RuntimeException> taskInitExceptions = new LinkedHashMap<>(); + Stream.concat(newActiveTasks.stream(), newStandbyTask.stream()) + .forEach(t -> addTaskToStateUpdater(t, taskInitExceptions)); Review Comment: If that is the case, especially if it takes a long time to init rocksdb, maybe it would be the be easier to initialize the state in the state updater instead? ########## streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java: ########## @@ -395,8 +395,10 @@ private void createNewTasks(final Map<TaskId, Set<TopicPartition>> activeTasksTo tasks.addActiveTasks(newActiveTasks); tasks.addStandbyTasks(newStandbyTask); } else { - tasks.addPendingTaskToInit(newActiveTasks); - tasks.addPendingTaskToInit(newStandbyTask); + final Map<TaskId, RuntimeException> taskInitExceptions = new LinkedHashMap<>(); + Stream.concat(newActiveTasks.stream(), newStandbyTask.stream()) + .forEach(t -> addTaskToStateUpdater(t, taskInitExceptions)); Review Comment: If that is the case, especially if it takes a long time to init rocksdb, maybe it would be easier to initialize the state in the state updater instead? -- 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