tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-3536. NPE in WebUIService start when host resolution fails. (hitesh)
Date Mon, 14 Nov 2016 21:32:56 GMT
Repository: tez
Updated Branches:
  refs/heads/branch-0.7 1b315ef9c -> f28bb4b2c


TEZ-3536. NPE in WebUIService start when host resolution fails. (hitesh)

(cherry picked from commit b71ea4aabfc9007c2e485bc4cb30286c9ae34061)

Conflicts:
	CHANGES.txt

(cherry picked from commit e95c68204aa73d47c2cd58ab39b5aaadcad4f1e9)

Conflicts:
	CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/f28bb4b2
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/f28bb4b2
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/f28bb4b2

Branch: refs/heads/branch-0.7
Commit: f28bb4b2c61164b03f9b207bdbf25e66ccf4582d
Parents: 1b315ef
Author: Hitesh Shah <hitesh@apache.org>
Authored: Mon Nov 14 13:13:51 2016 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Mon Nov 14 13:26:49 2016 -0800

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../java/org/apache/tez/dag/app/web/WebUIService.java | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/f28bb4b2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e6f1a5e..cad378e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
 
 ALL CHANGES:
 
+  TEZ-3536. NPE in WebUIService start when host resolution fails.
   TEZ-3493. DAG submit timeout cannot be set to a month
   TEZ-3505. Move license to the file header for TezBytesWritableSerialization
   TEZ-3486. COMBINE_OUTPUT_RECORDS/COMBINE_INPUT_RECORDS are not correct

http://git-wip-us.apache.org/repos/asf/tez/blob/f28bb4b2/tez-dag/src/main/java/org/apache/tez/dag/app/web/WebUIService.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/web/WebUIService.java b/tez-dag/src/main/java/org/apache/tez/dag/app/web/WebUIService.java
index a894d25..1ac178b 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/web/WebUIService.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/web/WebUIService.java
@@ -94,8 +94,18 @@ public class WebUIService extends AbstractService {
             .start(this.tezAMWebApp);
         InetSocketAddress address = webApp.getListenerAddress();
         if (address != null) {
-          InetSocketAddress bindAddress = NetUtils.createSocketAddrForHost(context.getAppMaster().getAppNMHost(),
address.getPort());
-          trackingUrl = "http://" + bindAddress.getAddress().getCanonicalHostName() + ":"
+ bindAddress.getPort() + "/ui/";
+          InetSocketAddress bindAddress = NetUtils.createSocketAddrForHost(
+              context.getAppMaster().getAppNMHost(), address.getPort());
+          String hostname = context.getAppMaster().getAppNMHost();
+          final int port = address.getPort();
+          if (bindAddress.getAddress() != null
+              && bindAddress.getAddress().getCanonicalHostName() != null) {
+            hostname = bindAddress.getAddress().getCanonicalHostName();
+          } else {
+            LOG.warn("Failed to resolve canonical hostname for "
+                + context.getAppMaster().getAppNMHost());
+          }
+          trackingUrl = "http://" + hostname + ":" + port + "/ui/";
           LOG.info("Instantiated WebUIService at " + trackingUrl);
         }
       } catch (Exception e) {


Mime
View raw message