瀏覽代碼

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 19 年之前
父節點
當前提交
119226c1cb
共有 1 個文件被更改,包括 1 次插入1 次删除
  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) {