Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EE34F200C31 for ; Wed, 8 Mar 2017 19:49:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ECBAC160B83; Wed, 8 Mar 2017 18:49:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3FF18160B73 for ; Wed, 8 Mar 2017 19:49:15 +0100 (CET) Received: (qmail 83605 invoked by uid 500); 8 Mar 2017 18:49:14 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 83594 invoked by uid 99); 8 Mar 2017 18:49:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2017 18:49:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2C090DFBD3; Wed, 8 Mar 2017 18:49:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jianhe@apache.org To: common-commits@hadoop.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HADOOP-14062. ApplicationMasterProtocolPBClientImpl.allocate fails with EOFException when RPC privacy is enabled. Contributed by Steven Rand Date: Wed, 8 Mar 2017 18:49:14 +0000 (UTC) archived-at: Wed, 08 Mar 2017 18:49:16 -0000 Repository: hadoop Updated Branches: refs/heads/branch-2 11d4cdc3a -> 36eda5af7 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/36eda5af Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/36eda5af Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/36eda5af Branch: refs/heads/branch-2 Commit: 36eda5af75a1c98b507ea497fce51aa936b2c699 Parents: 11d4cdc Author: Jian He Authored: Wed Mar 8 10:48:27 2017 -0800 Committer: Jian He Committed: Wed Mar 8 10:49:07 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/36eda5af/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 5d3f22f..32da353 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 @@ -1770,7 +1770,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/36eda5af/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 06ae828..329746b 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 @@ -159,6 +159,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(); @@ -868,6 +873,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