ableegoldman commented on a change in pull request #9835:
URL: https://github.com/apache/kafka/pull/9835#discussion_r556029628
##########
File path:
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java
##########
@@ -804,45 +749,42 @@ private void closeTaskDirty(final Task task) {
} catch (final RuntimeException swallow) {
log.error("Error suspending dirty task {} ", task.id(), swallow);
}
- cleanupTask(task);
+ tasks.removeTaskBeforeClosing(task.id());
task.closeDirty();
}
private void completeTaskCloseClean(final Task task) {
- cleanupTask(task);
+ tasks.removeTaskBeforeClosing(task.id());
task.closeClean();
}
- // Note: this MUST be called *before* actually closing the task
- private void cleanupTask(final Task task) {
- for (final TopicPartition inputPartition : task.inputPartitions()) {
- partitionToTask.remove(inputPartition);
- }
- }
-
void shutdown(final boolean clean) {
final AtomicReference<RuntimeException> firstException = new
AtomicReference<>(null);
final Set<Task> tasksToCloseDirty = new HashSet<>();
+ // TODO: change type to `StreamTask`
+ final Set<Task> activeTasks = new
TreeSet<>(Comparator.comparing(Task::id));
Review comment:
No worries, let's keep the scope small for now. Just wanted to raise the
question
----------------------------------------------------------------
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:
[email protected]