You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2024/10/30 03:08:04 UTC

(iotdb) branch master updated: Fix IoTV2 metric NPE due to concurrency #13951

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 84c115d25e8 Fix IoTV2 metric NPE due to concurrency #13951
84c115d25e8 is described below

commit 84c115d25e8e22a61a9c880a0533a76396238e93
Author: Potato <ta...@apache.org>
AuthorDate: Wed Oct 30 11:07:58 2024 +0800

    Fix IoTV2 metric NPE due to concurrency #13951
    
    Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
 .../db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java
index 50fa549b623..54a1d1b9592 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java
@@ -116,7 +116,6 @@ public class PipeConsensusReceiver {
     this.consensusGroupId = consensusGroupId;
     this.pipeConsensusReceiverMetrics = new PipeConsensusReceiverMetrics(this);
     this.consensusPipeName = consensusPipeName;
-    MetricService.getInstance().addMetricSet(pipeConsensusReceiverMetrics);
 
     // Each pipeConsensusReceiver has its own base directories. for example, a default dir path is
     // data/datanode/system/pipe/consensus/receiver/__consensus.{consensusGroupId}_{leaderDataNodeId}_{followerDataNodeId}
@@ -145,6 +144,7 @@ public class PipeConsensusReceiver {
     }
     this.requestExecutor =
         new RequestExecutor(pipeConsensusReceiverMetrics, pipeConsensusTsFileWriterPool);
+    MetricService.getInstance().addMetricSet(pipeConsensusReceiverMetrics);
   }
 
   /**