This is an automated email from the ASF dual-hosted git repository. eyang pushed a commit to branch branch-3.2 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push: new 860606f YARN-9581. Add support for get multiple RM webapp URLs. Contributed by Prabhu Joseph 860606f is described below commit 860606fc670ed3ebc9ad034293bab9734e655bbd Author: Eric Yang <ey...@apache.org> AuthorDate: Fri Jun 28 14:51:58 2019 -0400 YARN-9581. Add support for get multiple RM webapp URLs. Contributed by Prabhu Joseph (cherry picked from commit f02b0e19940dc6fc1e19258a40db37d1eed89d21) --- .../java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java index 5b1c3bb..09daf42 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java @@ -102,8 +102,16 @@ public class WebAppUtils { return func.apply(rm1Address, arg); } catch (Exception e) { if (HAUtil.isHAEnabled(conf)) { - String rm2Address = getRMWebAppURLWithScheme(conf, 1); - return func.apply(rm2Address, arg); + int rms = HAUtil.getRMHAIds(conf).size(); + for (int i=1; i<rms; i++) { + try { + rm1Address = getRMWebAppURLWithScheme(conf, i); + return func.apply(rm1Address, arg); + } catch (Exception e1) { + // ignore and try next one when RM is down + e = e1; + } + } } throw e; } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org