Explorar o código

Fix a bug where writing zero-length files would cause things to hang.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@390716 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting %!s(int64=19) %!d(string=hai) anos
pai
achega
119226c1cb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/java/org/apache/hadoop/dfs/DataNode.java

+ 1 - 1
src/java/org/apache/hadoop/dfs/DataNode.java

@@ -403,7 +403,7 @@ public class DataNode implements FSConstants, Runnable {
                                 // maybe to network.
                                 //
                                 try {
-                                    boolean anotherChunk = true;
+                                    boolean anotherChunk = len != 0;
                                     byte buf[] = new byte[BUFFER_SIZE];
 
                                     while (anotherChunk) {