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 52209200C81 for ; Fri, 12 May 2017 06:48:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 50B28160BCA; Fri, 12 May 2017 04:48:25 +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 9766C160BC7 for ; Fri, 12 May 2017 06:48:24 +0200 (CEST) Received: (qmail 40309 invoked by uid 500); 12 May 2017 04:48:23 -0000 Mailing-List: contact commits-help@sentry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sentry.apache.org Delivered-To: mailing list commits@sentry.apache.org Received: (qmail 40300 invoked by uid 99); 12 May 2017 04:48:23 -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; Fri, 12 May 2017 04:48:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 52C88DFD70; Fri, 12 May 2017 04:48:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akolb@apache.org To: commits@sentry.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: sentry git commit: SENTRY-1717: Sentry should emit log messages when it is ready to serve requests (Na Li, reviewed by Alex Kolbasov) Date: Fri, 12 May 2017 04:48:23 +0000 (UTC) archived-at: Fri, 12 May 2017 04:48:25 -0000 Repository: sentry Updated Branches: refs/heads/sentry-ha-redesign 0acd85384 -> 7da5d5e57 SENTRY-1717: Sentry should emit log messages when it is ready to serve requests (Na Li, reviewed by Alex Kolbasov) Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/7da5d5e5 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/7da5d5e5 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/7da5d5e5 Branch: refs/heads/sentry-ha-redesign Commit: 7da5d5e571376c3b8ae399b92d7db6e97dc66b41 Parents: 0acd853 Author: Alexander Kolbasov Authored: Thu May 11 21:48:00 2017 -0700 Committer: Alexander Kolbasov Committed: Thu May 11 21:48:00 2017 -0700 ---------------------------------------------------------------------- .../java/org/apache/sentry/service/thrift/HMSFollower.java | 8 ++++++++ .../java/org/apache/sentry/service/thrift/SentryService.java | 4 ++++ 2 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/7da5d5e5/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java index 9880c40..5e6b906 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java @@ -84,6 +84,7 @@ public class HMSFollower implements Runnable, AutoCloseable { private String hiveInstance; private boolean needHiveSnapshot = true; + private boolean needLogHMSSupportReady = true; private final LeaderStatusMonitor leaderMonitor; HMSFollower(Configuration conf, SentryStore store, LeaderStatusMonitor leaderMonitor) throws Exception { @@ -306,6 +307,13 @@ public class HMSFollower implements Runnable, AutoCloseable { wakeUpWaitingClientsForSync(currentEventID); } + // HMSFollower connected to HMS and it finished full snapshot if that was required + // Log this message only once + if (needLogHMSSupportReady && connectedToHMS) { + LOGGER.info("Sentry HMS support is ready"); + needLogHMSSupportReady = false; + } + // HIVE-15761: Currently getNextNotification API may return an empty // NotificationEventResponse causing TProtocolException. // Workaround: Only processes the notification events newer than the last updated one. http://git-wip-us.apache.org/repos/asf/sentry/blob/7da5d5e5/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java index 3ea7ebf..6fb224c 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java @@ -266,6 +266,10 @@ public class SentryService implements Callable, SigUtils.SigListener { thriftServer = new TThreadPoolServer(args); LOGGER.info("Serving on " + address); startSentryWebServer(); + + // thriftServer.serve() does not return until thriftServer is stopped. Need to log before + // calling thriftServer.serve() + LOGGER.info("Sentry service is ready to serve client requests"); thriftServer.serve(); }