浏览代码

HADOOP-16266. Add more fine-grained processing time metrics to the RPC layer -follow-on patch.

This follow-on patch to HADOOP-16266 fixes up the problem where logs were being full of
stack traces because the timeout passed down to select was in nanos, whereas the API
expected millis.

Contributed by Erik Krogen.

Change-Id: I5c6e9ddf68127b1d7e0ca0e179d036eb9941e445
Steve Loughran 6 年之前
父节点
当前提交
827a84778a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

+ 2 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java

@@ -1482,7 +1482,8 @@ public abstract class Server {
       while (running) {
         try {
           waitPending();     // If a channel is being registered, wait.
-          writeSelector.select(PURGE_INTERVAL_NANOS);
+          writeSelector.select(
+              TimeUnit.NANOSECONDS.toMillis(PURGE_INTERVAL_NANOS));
           Iterator<SelectionKey> iter = writeSelector.selectedKeys().iterator();
           while (iter.hasNext()) {
             SelectionKey key = iter.next();