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); } }