HDFS-14048. DFSOutputStream close() throws exception on subsequent call after DataNode restart. Contributed by Erik Krogen.
(cherry picked from commit 887244de4adebe27693ed4ad3296a6f700cfa8c1)
This commit is contained in:
parent
7335d940de
commit
f65324aa47
@ -1781,6 +1781,7 @@ boolean createBlockOutputStream(DatanodeInfo[] nodes,
|
||||
blockStream = out;
|
||||
result = true; // success
|
||||
errorState.resetInternalError();
|
||||
lastException.clear();
|
||||
// remove all restarting nodes from failed nodes list
|
||||
failed.removeAll(restartingNodes);
|
||||
restartingNodes.clear();
|
||||
|
@ -436,6 +436,8 @@ public Boolean get() {
|
||||
0, out.getStreamer().getPipelineRecoveryCount());
|
||||
out.write(1);
|
||||
out.close();
|
||||
// Ensure that subsequent closes are idempotent and do not throw errors
|
||||
out.close();
|
||||
} finally {
|
||||
if (cluster != null) {
|
||||
cluster.shutdown();
|
||||
|
Loading…
x
Reference in New Issue
Block a user