tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject [43/50] [abbrv] tez git commit: TEZ-3536. NPE in WebUIService start when host resolution fails. (hitesh)
Date Tue, 06 Dec 2016 17:07:14 GMT
TEZ-3536. NPE in WebUIService start when host resolution fails. (hitesh)


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

Branch: refs/heads/TEZ-3334
Commit: b71ea4aabfc9007c2e485bc4cb30286c9ae34061
Parents: 2c4ef9f
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:13:51 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/tez/blob/b71ea4aa/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 0948862..cac97f9 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-3269. Provide basic fair routing and scheduling functionality via custom VertexManager
and EdgeManager.
   TEZ-3534. Differentiate thread names on Fetchers, minor changes to shuffle shutdown code.
   TEZ-3491. Tez job can hang due to container priority inversion.
@@ -148,6 +149,7 @@ INCOMPATIBLE CHANGES
 
 ALL CHANGES:
 
+  TEZ-3536. NPE in WebUIService start when host resolution fails.
   TEZ-3534. Differentiate thread names on Fetchers, minor changes to shuffle shutdown code.
   TEZ-3491. Tez job can hang due to container priority inversion.
   TEZ-3533. ShuffleScheduler should shutdown threadpool on exit.
@@ -655,6 +657,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/b71ea4aa/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