You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by di...@apache.org on 2024/03/21 03:41:43 UTC

(hadoop) branch trunk updated: HDFS-17433. metrics sumOfActorCommandQueueLength should only record valid commands. (#6644)

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

dineshc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2eb7246ea754 HDFS-17433. metrics sumOfActorCommandQueueLength should only record valid commands. (#6644)
2eb7246ea754 is described below

commit 2eb7246ea754af456350723e5ea8ec397c1eb1f5
Author: hfutatzhanghb <hf...@163.com>
AuthorDate: Thu Mar 21 11:41:35 2024 +0800

    HDFS-17433. metrics sumOfActorCommandQueueLength should only record valid commands. (#6644)
---
 .../java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index 462b9df3c9c8..da30d057966c 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -1487,8 +1487,10 @@ class BPServiceActor implements Runnable {
     }
 
     void enqueue(DatanodeCommand[] cmds) throws InterruptedException {
-      queue.put(() -> processCommand(cmds));
-      dn.getMetrics().incrActorCmdQueueLength(1);
+      if (cmds.length != 0) {
+        queue.put(() -> processCommand(cmds));
+        dn.getMetrics().incrActorCmdQueueLength(1);
+      }
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org