You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2018/11/06 19:27:16 UTC
[2/4] hadoop git commit: HDFS-14048. DFSOutputStream close() throws
exception on subsequent call after DataNode restart. Contributed by Erik
Krogen.
HDFS-14048. DFSOutputStream close() throws exception on subsequent call after DataNode restart. Contributed by Erik Krogen.
(cherry picked from commit 887244de4adebe27693ed4ad3296a6f700cfa8c1)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e7fba62e
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e7fba62e
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e7fba62e
Branch: refs/heads/branch-3.2
Commit: e7fba62e6a248c8d5a0682de5d53a11ca01fd508
Parents: 9265934
Author: Inigo Goiri <in...@apache.org>
Authored: Tue Nov 6 11:18:15 2018 -0800
Committer: Inigo Goiri <in...@apache.org>
Committed: Tue Nov 6 11:20:06 2018 -0800
----------------------------------------------------------------------
.../src/main/java/org/apache/hadoop/hdfs/DataStreamer.java | 1 +
.../apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java | 2 ++
2 files changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7fba62e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
index c1473dd..4c733bf 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
@@ -1781,6 +1781,7 @@ class DataStreamer extends Daemon {
blockStream = out;
result = true; // success
errorState.resetInternalError();
+ lastException.clear();
// remove all restarting nodes from failed nodes list
failed.removeAll(restartingNodes);
restartingNodes.clear();
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e7fba62e/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java
index 3f8c7f7..465a083 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestClientProtocolForPipelineRecovery.java
@@ -436,6 +436,8 @@ public class TestClientProtocolForPipelineRecovery {
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();
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org