From d9492839d02ea51c8a8f6b8152ebd50369be59d0 Mon Sep 17 00:00:00 2001 From: Brahma Reddy Battula Date: Thu, 25 May 2017 01:27:13 +0800 Subject: [PATCH] HADOOP-14166. Reset the DecayRpcScheduler AvgResponseTime metric to zero when queue is not used. Contributed by Surendra Singh Lilhore. (cherry picked from commit dcf4559ebdb5bb11d03b264a9875bff316b89eef) --- .../src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java index 537de3726d8..fe9298f6704 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/DecayRpcScheduler.java @@ -618,6 +618,8 @@ public class DecayRpcScheduler implements RpcScheduler, } else { responseTimeAvgInLastWindow.set(i, averageResponseTime); } + } else { + responseTimeAvgInLastWindow.set(i, 0); } responseTimeCountInLastWindow.set(i, responseTimeCount); if (LOG.isDebugEnabled()) {