FrankYang0529 commented on code in PR #19856:
URL: https://github.com/apache/kafka/pull/19856#discussion_r2121602544


##########
clients/src/main/java/org/apache/kafka/clients/GroupRebalanceConfig.java:
##########
@@ -73,6 +74,16 @@ public GroupRebalanceConfig(AbstractConfig config, 
ProtocolType protocolType) {
             this.groupInstanceId = Optional.empty();
         }
 
+        // The WorkerGroupMember in connect module also uses this class, but 
there is no client.rack in DistributedConfig.
+        // Ignore the rackId in that case to avoid ConfigException.
+        // The GroupCoordinatorService throws error if the rackId is empty. 
The default value of client.rack is empty string.
+        // Skip empty rackId to avoid InvalidRequestException.
+        if 
(config.values().containsKey(CommonClientConfigs.CLIENT_RACK_CONFIG) && 
!config.getString(CommonClientConfigs.CLIENT_RACK_CONFIG).isEmpty()) {
+            this.rackId = 
Optional.ofNullable(config.getString(CommonClientConfigs.CLIENT_RACK_CONFIG));
+        } else {
+            this.rackId = Optional.empty();
+        }

Review Comment:
   I change to do this when protocol type is CONSUMER or SHARE, because they 
all support the field.



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

Reply via email to