vyommani commented on code in PR #575: URL: https://github.com/apache/ranger/pull/575#discussion_r2088311731
########## kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSWebApp.java: ########## @@ -133,7 +134,7 @@ public static KMSAudit getKMSAudit() { } public static boolean isMetricCollectionThreadSafe() { - return Boolean.parseBoolean(KMSWebApp.getConfiguration().get(HADOOP_KMS_METRIC_COLLECTION_THREADSAFE, "false")); + return isMetricsCollectionThreadsafe; Review Comment: It appears you're correct that the isMetricCollectionThreadSafe variable isn't initialized in getKMSMetricsCollector. Since isMetricCollectionThreadSafe() is a public static method, its behavior now depends on whether the context is initialized, which introduces a behavioral change. At line 186, the code calls isMetricCollectionThreadSafe(), and at line 185, you're setting the value of the isMetricsCollectionThreadsafe variable, which is used within isMetricCollectionThreadSafe(). Given that isMetricCollectionThreadSafe() is a public static method, I recommend initializing the isMetricsCollectionThreadsafe variable during class loading to ensure consistent behavior in the isMetricCollectionThreadSafe() method. -- 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: dev-unsubscr...@ranger.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org