TaiJuWu commented on code in PR #17168:
URL: https://github.com/apache/kafka/pull/17168#discussion_r1779303258


##########
server/src/main/java/org/apache/kafka/server/metrics/ClientMetricsConfigs.java:
##########
@@ -133,8 +134,8 @@ private static void validateProperties(Properties 
properties) {
 
         // Make sure that push interval is between 100ms and 1 hour.
         if (properties.containsKey(PUSH_INTERVAL_MS)) {
-            int pushIntervalMs = 
Integer.parseInt(properties.getProperty(PUSH_INTERVAL_MS));
-            if (pushIntervalMs < MIN_INTERVAL_MS || pushIntervalMs > 
MAX_INTERVAL_MS) {
+            Integer pushIntervalMs = (Integer) 
ConfigDef.parseType(PUSH_INTERVAL_MS, properties.getProperty(PUSH_INTERVAL_MS), 
Type.INT);
+            if (pushIntervalMs == null || pushIntervalMs < MIN_INTERVAL_MS || 
pushIntervalMs > MAX_INTERVAL_MS) {

Review Comment:
   Hi @apoorvmittal10, thanks for the review.
   
   If kafka-client-metrics.sh doesn't have pushIntervalMs, it should not enter 
this block (check in 137). 
   I added a null check just to ensure that null values are handled properly. 
   Ideally, the check should always pass.



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