Repository: impala
Updated Branches:
  refs/heads/master 3fa05604a -> bddd7def9


IMPALA-7470: SentryServicePinger logs error messages on success

SentryServicePinger checks if Sentry is running by calling a Sentry API
to get a list of roles. If Sentry is not yet running, an exception will
be thrown. However, the Sentry client implementation will log some error
messages when an exception is thrown. For the purpose of SentryServicePinger,
this can be too noisy and verbose and may also confuse other developers
into thinking it was a failure when starting Sentry. The log messages
were muted in IMPALA-6878, however since Impala no longer uses the
shaded version of Sentry client in IMPALA-7423, the patch in IMPALA-6878
no longer worked. This patch fixes the muting of Sentry error messages by
turning off the log level using the non-shaded version of Sentry Thrift
client.

Testing:
- Manually tested by starting Sentry and did not see any error messages
  logged into stdout.

Change-Id: I75782d23c1cb67564a9265bf3cc94fd590c7b666
Reviewed-on: http://gerrit.cloudera.org:8080/11281
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


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

Branch: refs/heads/master
Commit: f849eff42134e7d11311acaf834d20ddceefeb60
Parents: 3fa0560
Author: Fredy Wijaya <[email protected]>
Authored: Mon Aug 20 21:17:45 2018 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Tue Aug 21 19:52:40 2018 +0000

----------------------------------------------------------------------
 .../java/org/apache/impala/testutil/SentryServicePinger.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/f849eff4/fe/src/test/java/org/apache/impala/testutil/SentryServicePinger.java
----------------------------------------------------------------------
diff --git 
a/fe/src/test/java/org/apache/impala/testutil/SentryServicePinger.java 
b/fe/src/test/java/org/apache/impala/testutil/SentryServicePinger.java
index 705f58a..4361ef9 100644
--- a/fe/src/test/java/org/apache/impala/testutil/SentryServicePinger.java
+++ b/fe/src/test/java/org/apache/impala/testutil/SentryServicePinger.java
@@ -25,6 +25,7 @@ import org.apache.impala.authorization.SentryConfig;
 import org.apache.impala.authorization.User;
 import org.apache.impala.util.SentryPolicyService;
 import org.apache.log4j.Level;
+import org.apache.sentry.core.common.transport.SentryTransportFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,7 +44,8 @@ public class SentryServicePinger {
   public static void main(String[] args) throws Exception {
     // Programmatically disable Sentry Thrift logging since Sentry error 
logging can be
     // pretty noisy and verbose.
-    org.apache.log4j.Logger logger4j = 
org.apache.log4j.Logger.getLogger("sentry");
+    org.apache.log4j.Logger logger4j = org.apache.log4j.Logger.getLogger(
+        SentryTransportFactory.class.getPackage().getName());
     logger4j.setLevel(Level.OFF);
 
     // Parse command line options to get config file path.

Reply via email to