From c1596a6c3bb85b89a7a274702e8a93766ccef9d7 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Tue, 7 Feb 2012 00:21:19 +0000 Subject: [PATCH] Merge -c 1241285 from trunk to branch-0.23 to fix PREDUCE-3811. Made jobclient-to-AM retries configurable. Contributed by Siddharth Seth. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1241286 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/mapreduce/MRJobConfig.java | 7 +++++++ .../src/main/resources/mapred-default.xml | 7 +++++++ .../org/apache/hadoop/mapred/ClientServiceDelegate.java | 4 +++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index b2f71cc1f98..203d9ca8995 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -194,6 +194,9 @@ Release 0.23.1 - Unreleased MAPREDUCE-3756. Made single shuffle limit configurable. (Hitesh Shah via acmurthy) + MAPREDUCE-3811. Made jobclient-to-AM retries configurable. (sseth via + acmurthy) + BUG FIXES MAPREDUCE-3804. yarn webapp interface vulnerable to cross scripting attacks (Dave Thompson via bobby) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java index c60fe25c2de..9af6981c62f 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/MRJobConfig.java @@ -320,6 +320,13 @@ public interface MRJobConfig { public static final String MR_AM_PREFIX = MR_PREFIX + "am."; + /** The number of client retires to the AM - before reconnecting to the RM + * to fetch Application State. + */ + public static final String MR_CLIENT_TO_AM_IPC_MAX_RETRIES = + MR_PREFIX + "client-am.ipc.max-retries"; + public static final int DEFAULT_MR_CLIENT_TO_AM_IPC_MAX_RETRIES = 3; + /** The staging directory for map reduce.*/ public static final String MR_AM_STAGING_DIR = MR_AM_PREFIX+"staging-dir"; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml index 6681b1a9275..80406132a44 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/resources/mapred-default.xml @@ -1255,4 +1255,11 @@ heartbeats to the ResourceManager + + yarn.app.mapreduce.client-am.ipc.max-retries + 1 + The number of client retries to the AM - before reconnecting + to the RM to fetch Application Status. + + diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java index 8186dcd6a73..b308c1a074c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/ClientServiceDelegate.java @@ -101,7 +101,9 @@ public class ClientServiceDelegate { this.conf = new Configuration(conf); // Cloning for modifying. // For faster redirects from AM to HS. this.conf.setInt( - CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 3); + CommonConfigurationKeysPublic.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, + this.conf.getInt(MRJobConfig.MR_CLIENT_TO_AM_IPC_MAX_RETRIES, + MRJobConfig.DEFAULT_MR_CLIENT_TO_AM_IPC_MAX_RETRIES)); this.rm = rm; this.jobId = jobId; this.historyServerProxy = historyServerProxy;