From 18c07b8dd389aa1d5e9e3e4bdab8f30dc492675a Mon Sep 17 00:00:00 2001 From: xianjingfeng Date: Wed, 7 Jun 2023 11:00:58 +0800 Subject: [PATCH] fix incorrect metric grpc_server_connection_number --- .../uniffle/common/rpc/MonitoringServerTransportFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/apache/uniffle/common/rpc/MonitoringServerTransportFilter.java b/common/src/main/java/org/apache/uniffle/common/rpc/MonitoringServerTransportFilter.java index 2c29dd27a6..ef687ec416 100644 --- a/common/src/main/java/org/apache/uniffle/common/rpc/MonitoringServerTransportFilter.java +++ b/common/src/main/java/org/apache/uniffle/common/rpc/MonitoringServerTransportFilter.java @@ -37,7 +37,9 @@ public Attributes transportReady(Attributes transportAttrs) { } public void transportTerminated(Attributes transportAttrs) { - grpcMetrics.decGauge(GRPC_SERVER_CONNECTION_NUMBER_KEY); + if (transportAttrs != null) { + grpcMetrics.decGauge(GRPC_SERVER_CONNECTION_NUMBER_KEY); + } super.transportTerminated(transportAttrs); } }