diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index f33f5dc4a3..a49b5ec692 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -1089,7 +1089,10 @@ public final void sendResponse() throws IOException { int count = responseWaitCount.decrementAndGet(); assert count >= 0 : "response has already been sent"; if (count == 0) { + long startNanos = Time.monotonicNowNanos(); doResponse(null); + getProcessingDetails().set(Timing.RESPONSE, + Time.monotonicNowNanos() - startNanos, TimeUnit.NANOSECONDS); } } @@ -1257,14 +1260,10 @@ public Void run() throws Exception { deltaNanos -= details.get(Timing.LOCKSHARED, TimeUnit.NANOSECONDS); deltaNanos -= details.get(Timing.LOCKEXCLUSIVE, TimeUnit.NANOSECONDS); details.set(Timing.LOCKFREE, deltaNanos, TimeUnit.NANOSECONDS); - startNanos = Time.monotonicNowNanos(); setResponseFields(value, responseParams); sendResponse(); - details.setReturnStatus(responseParams.returnStatus); - deltaNanos = Time.monotonicNowNanos() - startNanos; - details.set(Timing.RESPONSE, deltaNanos, TimeUnit.NANOSECONDS); } else { LOG.debug("Deferring response for callId: {}", this.callId); }