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 10BB8200BBF for ; Mon, 14 Nov 2016 22:32:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0F218160B06; Mon, 14 Nov 2016 21:32:58 +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 57D75160AF4 for ; Mon, 14 Nov 2016 22:32:57 +0100 (CET) Received: (qmail 59439 invoked by uid 500); 14 Nov 2016 21:32:56 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 59425 invoked by uid 99); 14 Nov 2016 21:32:56 -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; Mon, 14 Nov 2016 21:32:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4C288DFFAB; Mon, 14 Nov 2016 21:32:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hitesh@apache.org To: commits@tez.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-3536. NPE in WebUIService start when host resolution fails. (hitesh) Date: Mon, 14 Nov 2016 21:32:56 +0000 (UTC) archived-at: Mon, 14 Nov 2016 21:32:58 -0000 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 Authored: Mon Nov 14 13:13:51 2016 -0800 Committer: Hitesh Shah 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) {