소스 검색

If close() fails, then abandon the file, so that any leases are
cleared and other task may attempt to create it.


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@390717 13f79535-47bb-0310-9956-ffa450edef68

Doug Cutting 19 년 전
부모
커밋
09d93f190f
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      src/java/org/apache/hadoop/dfs/DFSClient.java

+ 6 - 1
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -809,7 +809,12 @@ class DFSClient implements FSConstants {
 
             flush();
             if (filePos == 0 || bytesWrittenToBlock != 0) {
-              endBlock();
+              try {
+                endBlock();
+              } catch (IOException e) {
+                namenode.abandonFileInProgress(src.toString());
+                throw e;
+              }
             }
 
             backupStream.close();