This is an automated email from the ASF dual-hosted git repository.

spolavarapu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b5fc47  RANGER-2809: Setting UGI from Jaas config file before 
initializing solr plugin
2b5fc47 is described below

commit 2b5fc4796f6ab1dafaf682a8fb6f647812261d5a
Author: Sailaja Polavarapu <spolavar...@cloudera.com>
AuthorDate: Mon Apr 27 14:31:30 2020 -0700

    RANGER-2809: Setting UGI from Jaas config file before initializing solr 
plugin
---
 .../authorization/solr/authorizer/RangerSolrAuthorizer.java  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
 
b/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
index 30b9861..5b9241a 100644
--- 
a/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
+++ 
b/plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
@@ -198,18 +198,16 @@ public class RangerSolrAuthorizer extends SearchComponent 
implements Authorizati
                                        me = solrPlugin;
                                        logger.info("RangerSolrAuthorizer(): 
init called");
                                        if (me == null) {
+                                               authToJAASFile();
+                                               logger.info("Creating 
RangerSolrPlugin");
                                                me = solrPlugin = new 
RangerBasePlugin("solr", "solr");
                                        }
                                }
                        }
+                       logger.info("Calling solrPlugin.init()");
                        solrPlugin.init();
                        auditHandler = new 
RangerSolrAuditHandler(solrPlugin.getConfig());
                        solrPlugin.setResultProcessor(auditHandler);
-               } catch (Throwable t) {
-                       logger.fatal("Error creating and initializing 
RangerBasePlugin()");
-               }
-
-               try {
                        useProxyIP = solrPlugin.getConfig().getBoolean(
                                        PROP_USE_PROXY_IP, useProxyIP);
                        proxyIPHeader = solrPlugin.getConfig().get(
@@ -226,10 +224,8 @@ public class RangerSolrAuthorizer extends SearchComponent 
implements Authorizati
                        logger.info("init(): solrAppName=" + solrAppName);
                        logger.info("init(): KerberosName.rules="
                                        + MiscUtil.getKerberosNamesRules());
-                       authToJAASFile();
-
                } catch (Throwable t) {
-                       logger.fatal("Error init", t);
+                       logger.fatal("Error creating and initializing 
RangerBasePlugin()");
                }
        }
 

Reply via email to