ojasvajain commented on code in PR #23696:
URL: https://github.com/apache/kafka/pull/23696#discussion_r4258229373


##########
server/src/main/java/org/apache/kafka/server/metrics/ClientMetricsConfigs.java:
##########
@@ -169,11 +185,39 @@ private static void validateConfigs(Map<?, ?> configs) {
             }
         }
 
-        // Make sure that client match patterns are valid by parsing them.
-        if (configs.containsKey(MATCH_CONFIG)) {
+        // Make sure that new or changed match patterns are valid RE2/J syntax.
+        if (configs.containsKey(MATCH_CONFIG) && matchPatternsChanged(configs, 
oldProps)) {
             List<String> patterns = (List<String>) parsed.get(MATCH_CONFIG);
-            // Parse the client matching patterns to validate if the patterns 
are valid.
-            parseMatchingPatterns(patterns);
+            patterns.forEach(pattern -> {
+                String[] nameValuePair = splitMatchPattern(pattern);

Review Comment:
   Yes, that's right. My thinking is - once someone's already touching a 
subscription's match config, it's reasonable to ask them to bring the whole 
list up to RE2/J compliance in the same request, rather than only checking the 
specific entry they added. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to