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
This commit is contained in:
Steve Loughran 2019-06-04 15:30:59 +01:00
parent 50909a7aa0
commit 827a84778a
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0

View File

@ -1482,7 +1482,8 @@ private void doRunLoop() {
while (running) { while (running) {
try { try {
waitPending(); // If a channel is being registered, wait. 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(); Iterator<SelectionKey> iter = writeSelector.selectedKeys().iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
SelectionKey key = iter.next(); SelectionKey key = iter.next();