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 2020/06/25 01:43:53 UTC

[GitHub] [kafka] ableegoldman commented on a change in pull request #8926: KAFKA-10166: always invoke `postCommit` before closing a task

ableegoldman commented on a change in pull request #8926:
URL: https://github.com/apache/kafka/pull/8926#discussion_r445262369



##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java
##########
@@ -242,18 +242,16 @@ public void handleAssignment(final Map<TaskId, Set<TopicPartition>> activeTasks,
 
         for (final Task task : tasksToClose) {
             try {
-                task.suspend(); // Should be a no-op for active tasks since they're suspended in handleRevocation
-                if (task.commitNeeded()) {
-                    if (task.isActive()) {
-                        log.error("Active task {} was revoked and should have already been committed", task.id());
-                        throw new IllegalStateException("Revoked active task was not committed during handleRevocation");

Review comment:
       This was another "sort-of bug": if we hit an exception in `handleRevocation` we wouldn't finish committing the active tasks, so `commitNeeded` could still be true. But of course, if we hit an exception earlier, we would have thrown it up to ConsumerCoordinator which would only save the first exception, so this didn't really do anything




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