This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a244a600e PHOENIX-7604 Log exceptions in GlobalClientMetrics static 
initializer (#2142)
1a244a600e is described below

commit 1a244a600e5775cc15fb66e0f2f725125cfdec85
Author: Istvan Toth <st...@apache.org>
AuthorDate: Thu May 8 17:02:24 2025 +0200

    PHOENIX-7604 Log exceptions in GlobalClientMetrics static initializer 
(#2142)
---
 .../apache/phoenix/monitoring/GlobalClientMetrics.java    | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
 
b/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
index f0f071cbcf..85671ac746 100644
--- 
a/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
+++ 
b/phoenix-core-client/src/main/java/org/apache/phoenix/monitoring/GlobalClientMetrics.java
@@ -177,11 +177,16 @@ public enum GlobalClientMetrics {
     private GlobalMetric metric;
 
     static {
-        initPhoenixGlobalClientMetrics();
-        if (isGlobalMetricsEnabled) {
-            MetricRegistry metricRegistry = createMetricRegistry();
-            registerPhoenixMetricsToRegistry(metricRegistry);
-            
GlobalMetricRegistriesAdapter.getInstance().registerMetricRegistry(metricRegistry);
+        try {
+            initPhoenixGlobalClientMetrics();
+            if (isGlobalMetricsEnabled) {
+                MetricRegistry metricRegistry = createMetricRegistry();
+                registerPhoenixMetricsToRegistry(metricRegistry);
+                
GlobalMetricRegistriesAdapter.getInstance().registerMetricRegistry(metricRegistry);
+            }
+        } catch (Throwable t) {
+            LOGGER.error("Failed to initialize GlobalClientMetrics", t);
+            throw t;
         }
     }
 

Reply via email to