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 44928200C2A for ; Wed, 15 Feb 2017 01:56:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 43263160B6D; Wed, 15 Feb 2017 00:56:45 +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 97A5A160B6A for ; Wed, 15 Feb 2017 01:56:44 +0100 (CET) Received: (qmail 33345 invoked by uid 500); 15 Feb 2017 00:56:38 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 33246 invoked by uid 99); 15 Feb 2017 00:56:38 -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; Wed, 15 Feb 2017 00:56:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20C12E0A2C; Wed, 15 Feb 2017 00:56:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: subru@apache.org To: common-commits@hadoop.apache.org Date: Wed, 15 Feb 2017 00:56:40 -0000 Message-Id: <6023e2f467864f02897852bb9f01a0cc@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [03/50] [abbrv] hadoop git commit: YARN-6170. TimelineReaderServer should wait to join with HttpServer2 (Sangjin Lee via Varun Saxena) archived-at: Wed, 15 Feb 2017 00:56:45 -0000 YARN-6170. TimelineReaderServer should wait to join with HttpServer2 (Sangjin Lee via Varun Saxena) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/649deb72 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/649deb72 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/649deb72 Branch: refs/heads/YARN-2915 Commit: 649deb72fbb62568b4ea0d67444df6faaaed169d Parents: 0aacd8f Author: Varun Saxena Authored: Sat Feb 11 19:21:45 2017 +0530 Committer: Varun Saxena Committed: Sat Feb 11 19:21:45 2017 +0530 ---------------------------------------------------------------------- .../timelineservice/reader/TimelineReaderServer.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/649deb72/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java index 76f7495..2835c1b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java @@ -110,6 +110,16 @@ public class TimelineReaderServer extends CompositeService { startTimelineReaderWebApp(); } + private void join() { + // keep the main thread that started the server up until it receives a stop + // signal + if (readerWebServer != null) { + try { + readerWebServer.join(); + } catch (InterruptedException ignore) {} + } + } + @Override protected void serviceStop() throws Exception { if (readerWebServer != null) { @@ -194,6 +204,7 @@ public class TimelineReaderServer extends CompositeService { Configuration conf = new YarnConfiguration(); conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 2.0f); - startTimelineReaderServer(args, conf); + TimelineReaderServer server = startTimelineReaderServer(args, conf); + server.join(); } } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org