steveloughran commented on code in PR #7063:
URL: https://github.com/apache/hadoop/pull/7063#discussion_r1804681945


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/datatransfer/TestPacketReceiver.java:
##########
@@ -61,7 +61,7 @@ private static byte[] remainingAsArray(ByteBuffer buf) {
   @Test
   public void testPacketSize() {
     assertEquals(PacketReceiver.MAX_PACKET_SIZE,
-            HdfsClientConfigKeys.DFS_DATA_TRANSFER_MAX_PACKET_SIZE_DEFAULT);
+        HdfsClientConfigKeys.DFS_DATA_TRANSFER_MAX_PACKET_SIZE_DEFAULT);

Review Comment:
   needless reformat, but I'm not sure about the ordering of the assertions 
here. 



##########
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/PacketReceiver.java:
##########
@@ -163,7 +163,8 @@ private void doRead(ReadableByteChannel ch, InputStream in)
     // Sanity check the buffer size so we don't allocate too much memory
     // and OOME.
     int totalLen = payloadLen + headerLen;
-    if (totalLen < 0 || totalLen > MAX_PACKET_SIZE) {
+    if (totalLen < 0 || totalLen > (MAX_PACKET_SIZE == 0 ?

Review Comment:
   the ?: stuff should be pulled out of the if clause; too complex



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to