|
@@ -1953,8 +1953,9 @@ public class DFSClient implements FSConstants {
|
|
|
" offsetInBlock:" + one.offsetInBlock +
|
|
|
" lastPacketInBlock:" + one.lastPacketInBlock);
|
|
|
}
|
|
|
- } catch (IOException e) {
|
|
|
- LOG.warn("DataStreamer Exception: " + e);
|
|
|
+ } catch (Throwable e) {
|
|
|
+ LOG.warn("DataStreamer Exception: " +
|
|
|
+ StringUtils.stringifyException(e));
|
|
|
hasError = true;
|
|
|
}
|
|
|
}
|
|
@@ -2703,6 +2704,7 @@ public class DFSClient implements FSConstants {
|
|
|
}
|
|
|
|
|
|
flushInternal(); // flush all data to Datanodes
|
|
|
+ isClosed();
|
|
|
closed = true;
|
|
|
|
|
|
closeThreads();
|
|
@@ -2725,6 +2727,8 @@ public class DFSClient implements FSConstants {
|
|
|
|
|
|
long localstart = System.currentTimeMillis();
|
|
|
boolean fileComplete = false;
|
|
|
+ int fileCompleteRetry = 0;
|
|
|
+ final int checkFileCompleteRetry = 10;
|
|
|
while (!fileComplete) {
|
|
|
fileComplete = namenode.complete(src, clientName);
|
|
|
if (!fileComplete) {
|
|
@@ -2735,6 +2739,9 @@ public class DFSClient implements FSConstants {
|
|
|
}
|
|
|
} catch (InterruptedException ie) {
|
|
|
}
|
|
|
+ // after retrying for checkFileCompleteRetry times check isClosed()
|
|
|
+ if ((++fileCompleteRetry % checkFileCompleteRetry) == 0)
|
|
|
+ isClosed();
|
|
|
}
|
|
|
}
|
|
|
} finally {
|