This is an automated email from the ASF dual-hosted git repository.

lucasbru pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7fa5121a172 MINOR:  Streams group should not be reported as failed 
solely due to an internal topic deletion error. (#21320)
7fa5121a172 is described below

commit 7fa5121a172e4ac0248c15e73d5833dcec9bb7d8
Author: Alieh Saeedi <[email protected]>
AuthorDate: Mon Jan 19 09:44:03 2026 +0100

    MINOR:  Streams group should not be reported as failed solely due to an 
internal topic deletion error. (#21320)
    
    When deleting a streams group, if the deletion of internal topics fails
    due to `UnknownTopicOrPartitionException`, we currently return an error.
    While this isn’t technically incorrect, it would be preferable to return
    exit code 0 here, since the group itself was successfully deleted and no
    internal topics remain (either because they were never created or
    because they were deleted manually).
    
    Reviewers: Lucas Brutschy <[email protected]>, Matthias J. Sax
     <[email protected]>
---
 .../java/org/apache/kafka/tools/streams/StreamsGroupCommand.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java 
b/tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java
index f76a81b9c19..11d52f63dc7 100644
--- 
a/tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java
+++ 
b/tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java
@@ -749,9 +749,14 @@ public class StreamsGroupCommand {
             if (!internalTopicsToBeDeleted.keySet().isEmpty()) {
                 printInternalTopicErrors(internalTopicsDeletionFailures, 
success.keySet(), internalTopicsToBeDeleted.keySet());
             }
-            // for testing purpose: return all failures, including internal 
topics deletion failures
+            // for testing purpose: return all failures,
+            // however we don’t want the operation to fail just because 
internal topics were not found to be deleted.
+            internalTopicsDeletionFailures.forEach((group, error) -> {
+                if (!(error instanceof UnknownTopicOrPartitionException)) {
+                    failed.put(group, error);
+                }
+            });
             failed.putAll(success);
-            failed.putAll(internalTopicsDeletionFailures);
             return failed;
         }
 

Reply via email to