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 ji...@apache.org on 2017/03/08 18:48:52 UTC
hadoop git commit: HADOOP-14062.
ApplicationMasterProtocolPBClientImpl.allocate fails with EOFException when
RPC privacy is enabled. Contributed by Steven Rand
Repository: hadoop
Updated Branches:
refs/heads/trunk 287ba4ffa -> 241c1cc05
HADOOP-14062. ApplicationMasterProtocolPBClientImpl.allocate fails with EOFException when RPC privacy is enabled. Contributed by Steven Rand
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/241c1cc0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/241c1cc0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/241c1cc0
Branch: refs/heads/trunk
Commit: 241c1cc05b71f8b719a85c06e3df930639630726
Parents: 287ba4f
Author: Jian He <ji...@apache.org>
Authored: Wed Mar 8 10:48:27 2017 -0800
Committer: Jian He <ji...@apache.org>
Committed: Wed Mar 8 10:48:27 2017 -0800
----------------------------------------------------------------------
.../main/java/org/apache/hadoop/ipc/Client.java | 4 +++-
.../yarn/client/api/impl/TestAMRMClient.java | 24 ++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/241c1cc0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
index 70b902c..c0a5be9 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java
@@ -1768,7 +1768,9 @@ public class Client implements AutoCloseable {
}
void setSaslClient(SaslRpcClient client) throws IOException {
- setInputStream(client.getInputStream(in));
+ // Wrap the input stream in a BufferedInputStream to fill the buffer
+ // before reading its length (HADOOP-14062).
+ setInputStream(new BufferedInputStream(client.getInputStream(in)));
setOutputStream(client.getOutputStream(out));
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/241c1cc0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
index 43c0271..a52963a 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClient.java
@@ -137,6 +137,11 @@ public class TestAMRMClient {
// set the minimum allocation so that resource decrease can go under 1024
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 512);
conf.setLong(YarnConfiguration.NM_LOG_RETAIN_SECONDS, 1);
+ createClientAndCluster(conf);
+ }
+
+ private static void createClientAndCluster(Configuration conf)
+ throws Exception {
yarnCluster = new MiniYARNCluster(TestAMRMClient.class.getName(), nodeCount, 1, 1);
yarnCluster.init(conf);
yarnCluster.start();
@@ -862,6 +867,25 @@ public class TestAMRMClient {
}
@Test (timeout=60000)
+ public void testAMRMClientWithSaslEncryption() throws Exception {
+ conf.set("hadoop.rpc.protection", "privacy");
+ // we have to create a new instance of MiniYARNCluster to avoid SASL qop
+ // mismatches between client and server
+ tearDown();
+ createClientAndCluster(conf);
+ startApp();
+ initAMRMClientAndTest(false);
+
+ // recreate the original MiniYARNCluster and YarnClient for other tests
+ conf.unset("hadoop.rpc.protection");
+ tearDown();
+ createClientAndCluster(conf);
+ // unless we start an application the cancelApp() method will fail when
+ // it runs after this test
+ startApp();
+ }
+
+ @Test (timeout=60000)
public void testAMRMClientAllocReqId() throws YarnException, IOException {
initAMRMClientAndTest(true);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org