HDFS-9572. Prevent DataNode log spam if a client connects on the data transfer port but sends no data. Contributed by Chris Nauroth

(cherry picked from commit 03bab8dea1)
This commit is contained in:
cnauroth 2015-12-17 14:04:45 -08:00
parent c0733db768
commit 294d0f6f6a
2 changed files with 11 additions and 11 deletions

View File

@ -1648,6 +1648,9 @@ Release 2.8.0 - UNRELEASED
HDFS-9515. NPE when MiniDFSCluster#shutdown is invoked on uninitialized HDFS-9515. NPE when MiniDFSCluster#shutdown is invoked on uninitialized
reference. (Wei-Chiu Chuang via Arpit Agarwal) reference. (Wei-Chiu Chuang via Arpit Agarwal)
HDFS-9572. Prevent DataNode log spam if a client connects on the data
transfer port but sends no data. (cnauroth)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -233,18 +233,15 @@ class DataXceiver extends Receiver implements Runnable {
} catch (InterruptedIOException ignored) { } catch (InterruptedIOException ignored) {
// Time out while we wait for client rpc // Time out while we wait for client rpc
break; break;
} catch (IOException err) { } catch (EOFException | ClosedChannelException e) {
// Since we optimistically expect the next op, it's quite normal to get EOF here. // Since we optimistically expect the next op, it's quite normal to
if (opsProcessed > 0 && // get EOF here.
(err instanceof EOFException || err instanceof ClosedChannelException)) { LOG.debug("Cached {} closing after {} ops. " +
if (LOG.isDebugEnabled()) { "This message is usually benign.", peer, opsProcessed);
LOG.debug("Cached " + peer + " closing after " + opsProcessed + " ops");
}
} else {
incrDatanodeNetworkErrors();
throw err;
}
break; break;
} catch (IOException err) {
incrDatanodeNetworkErrors();
throw err;
} }
// restore normal timeout // restore normal timeout