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



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java
##########
@@ -409,9 +396,18 @@ public GroupAssignment assign(final Cluster metadata, 
final GroupSubscription gr
                 minSupportedMetadataVersion,
                 versionProbing,
                 probingRebalanceNeeded
-        );
+            );
 
-        return new GroupAssignment(assignment);
+            return new GroupAssignment(assignment);
+        } catch (final MissingSourceTopicException e) {
+            return new GroupAssignment(
+                errorAssignment(clientMetadataMap, 
AssignorError.INCOMPLETE_SOURCE_TOPIC_METADATA.code())
+            );
+        } catch (final TaskAssignmentException e) {
+            return new GroupAssignment(
+                errorAssignment(clientMetadataMap, 
AssignorError.ASSIGNMENT_ERROR.code())
+            );

Review comment:
       This is covered by 
`shouldEncodeAssignmentErrorIfPreVersionProbingSubscriptionAndFutureSubscriptionIsMixed`
 which hits the TaskAssignmentException in `checkMetadataVersions()`.
   
   I can try to add another test for one of the other instances where 
TaskAssignmentException might be thrown, but I would have to go really out of 
the way to artificially corrupt the data structures of the assignor in order to 
actually hit it (eg by mocking the `Cluster` so that it returns one set of 
topics the first time it's called, and then reports another set of topics the 
next time). I'm honestly not sure if it adds any value at that point -- WDYT?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to