You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Deepika-lab (via GitHub)" <gi...@apache.org> on 2026/09/24 04:16:39 UTC
[PR] KAFKA-21041: Fix ClientMetricsConfigs rejecting match patterns whose regex contains '=' [kafka]
Deepika-lab opened a new pull request, #23573:
URL: https://github.com/apache/kafka/pull/23573
Jira: https://issues.apache.org/jira/browse/KAFKA-21041
`ClientMetricsConfigs.parseMatchingPatterns` split client match patterns with `String.split("=")`, which splits on *every* `=` and rejects patterns like `client_id=foo=bar` with `InvalidConfigurationException`. The method's own Javadoc specifies that the pattern is split into two parts at the *first* occurrence of `=`, so this changes it to `split("=", 2)`, keeping any additional `=` characters as part of the regular expression.
Also adds `ClientMetricsConfigsTest` with focused unit tests for `parseMatchingPatterns` (valid patterns, empty input, invalid patterns throwing `InvalidConfigurationException`), including a regression test for regexes containing `=`.
Tests run (Gradle daemon cannot start in this sandbox, so compiled and ran directly with javac/java against kafka-clients 4.3.1 + JUnit 5):
- New `ClientMetricsConfigsTest`: 4 tests, all pass
- Verified the new regression test fails against the pre-fix code and passes with the fix
Note: I could not run `spotlessCheck`/`checkstyle` locally for the same environment reason; the change follows the surrounding style and import order. Happy to address any CI findings.
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-21041: Fix ClientMetricsConfigs rejecting match patterns whose regex contains '=' [kafka]
Posted by "DeepikaMamidipelly009 (via GitHub)" <gi...@apache.org>.
DeepikaMamidipelly009 closed pull request #23573: KAFKA-21041: Fix ClientMetricsConfigs rejecting match patterns whose regex contains '='
URL: https://github.com/apache/kafka/pull/23573
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org